I love XML Literals in VB.NET. They're a great way of generating valid XML instead of dealing with giant concatenated strings.
After discussing testing an XML Processing type class with a colleague this morning I thought I'd show him how this could be achieved quite nicely using XML literals. In his case; the code base is C# but that's not a problem for us.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We are able to create an XML document directly in the code instead of concatenating a string and parsing that into an XDocument. You get really nice intellisense whilst creating the document and you can also loop over a collection for example to generate the XML.
0 comments:
Post a Comment