Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8257549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:14:06+00:00 2026-06-08T02:14:06+00:00

I am creating an xml schema as <?xml version=1.0 encoding=UTF-8?> <string xmlns=http://tempuri.org/> <Inventories> <ID>

  • 0

I am creating an xml schema as

<?xml version="1.0" encoding="UTF-8"?>
<string xmlns="http://tempuri.org/">
<Inventories>
<ID>           </ID>
<Category>     </Category>
<Identity>     </Identity>
<Name>         </Name>
</Inventories>
</string>

with the following code

resultList = remoteWeb.Lists.GetByTitle("Server");
context.Load(resultList);
context.ExecuteQuery();
items = resultList.GetItems(new CamlQuery());
context.Load(items);
context.ExecuteQuery();
foreach (ListItem item in items)
{
    rootNode.AppendChild(doc.CreateElement("ID")).InnerText = "pcat:401820";
    rootNode.AppendChild(doc.CreateElement("Category")).InnerText = "Infrastructure.Server";
    rootNode.AppendChild(doc.CreateElement("Identity")).InnerText = Convert.ToString(item["ID"]);
    rootNode.AppendChild(doc.CreateElement("Name")).InnerText = Convert.ToString(item["Server_Name"]) + " >> " + Convert.ToString(item["Computer_Name"]) + " >> " + Convert.ToString(item["IP"]);
}

But we need to make xml as

<?xml version="1.0" encoding="UTF-8"?>
<string xmlns="http://tempuri.org/">
<Inventories>
<Inventory>
<ID>            </ID>
<Category>      </Category>
<Identity>      </Identity>
<Name>          </Name>
</Inventory>
</Inventories>

but did not figure out how to add container node under

All help will be appreciated, and thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T02:14:08+00:00Added an answer on June 8, 2026 at 2:14 am
    List<Inventory> items = new List<Inventory>();
    items.Add(new Inventory() { ID = "id1", Category = "c1", Identity = "i1", Name = "n1" });
    items.Add(new Inventory() { ID = "id2", Category = "c2", Identity = "i2", Name = "n2" });
    
    XmlSerializer xml = new XmlSerializer(typeof(List<Inventory>),new XmlRootAttribute("Inventories"));
    xml.Serialize(stream, items);
    

    –

    public class Inventory
    {
        public string ID;
        public string Category;
        public string Identity;
        public string Name;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following layout for my andriod app. <?xml version=1.0 encoding=utf-8?> <TableLayout xmlns:android=http://schemas.android.com/apk/res/android
I am creating an XML string using JQuery. I would like to open a
I need to validate a string that contains XML Data, there is no schema
I'm creating xml-like mark-up language using System.Xml.XmTextWriter that will be read by a third
We are creating many XML files for a single app in developing android applications;
I am creating serialized XML for a LINQ to SQL project using the DataContractSerializer
I'm creating an XML file using Perl and XML::Simple module. I successfully create the
I'm creating an XML document. I got it to indent using TransformerFactory.setAttribute(indent-number, new Integer(2));
I am creating an XML document on the fly. and I need to know
I am creating an xml file on the fly. When a user generates this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.