XmlDocument xDoc = new XmlDocument();
xDoc.LoadXml(sampleXmlStr); //In above line...utr string is loaded in to xmlDom. Here if instead of
//xDoc.LoadXml , u can use xDoc.Load(filePath) if ur xml is in some file.
//now see this variable.
string myData = xDoc.OuterXml;
//In above line u can see ur acutal xml.
Please mark this post as Answer if it is of help to you!
I would love to change the world, but they wont give me the source code.
kavita_khand...
Star
9767 Points
1930 Posts
Re: how to convert String to XML ???
Jul 06, 2009 04:56 AM|LINK
string sampleXmlStr = "<Order UserId=’ ‘ CustomerId=’ ’ TotalItem=’ ‘ TotalPrice=’ ‘>"+
"<OrderLine ItemId=’ ‘ Quantity=’ ‘ DiscountValue=’ ‘ TaxValue=’ ‘ Price=’ ‘ />"+
"<OrderLine ItemId=’ ‘ Quantity=’ ‘ DiscountValue=’ ‘ TaxValue=’ ‘ Price=’ ‘ />"+
"<OrderLine ItemId=’ ‘ Quantity=’ ‘ DiscountValue=’ ‘ TaxValue=’ ‘ Price=’ ‘ />";
XmlDocument xDoc = new XmlDocument();
xDoc.LoadXml(sampleXmlStr);
//In above line...utr string is loaded in to xmlDom. Here if instead of
//xDoc.LoadXml , u can use xDoc.Load(filePath) if ur xml is in some file.
//now see this variable.
string myData = xDoc.OuterXml;
//In above line u can see ur acutal xml.
I would love to change the world, but they wont give me the source code.