Tag Archives: XML literals

Use XML literals in C#

Visual Basic lets you include XML literals directly in your code as in the following example. Dim employees As XElement = <employees> <employee firstname=”Terry” lastname=”Pratchett”/> <employee firstname=”Glen” lastname=”Cook”/> <employee firstname=”Tom” lastname=”Holt”/> <employee> <firstname>Rod</firstname> <lastname>Stephens</lastname> </employee> </employees> Unfortunately, C# doesn’t allow … Continue reading

Posted in strings, XML | Tagged , , , , , , , | Leave a comment