- Joined
- Sep 1, 2007
- Sythe Gold
- 690
- Messages
- 6,681
MohtasaUnique has reported a post.
Reason:
Forum: General/Off Topic
Assigned Moderators: Josh0is0here, Pokemoners, JohnK
Posted by: jonathanp198
Original Content:
Reason:
Post: cegonsoft.in | LINQ to XMLAdvertising with his thread titles, and wrong section
Forum: General/Off Topic
Assigned Moderators: Josh0is0here, Pokemoners, JohnK
Posted by: jonathanp198
Original Content:
Consider that we want to create the following XML Document:
<?xml version="1.0"? encoding="utf-8">
<!–Xml Document–>
<catalog>
<book id="bk001">
<title>Book Title</title>
</book>
</catalog>
</xml>
Here is how we create the same XML document using Linq to Xml classes available in the System.Xml.Linq namespace:
XDocument doc =
new XDocument(
new XDeclaration("1.0", Encoding.UTF8.HeaderName, String.Empty),
new XComment("Xml Document"),
newXElement("catalog",
new XElement("book",
newXAttribute("id", "bk001"),
newXElement("title", "Book Title")
)
)
);
doc.Save("sampleLinq.xml");
..............................................
more information at Cegonsoft




