.NET and XML
.NET and XML Contents
Summary How to Write a Comment to a XML File with XmlTextWriter and WriteComment?
Comments can be sometimes very important to understand the structure of XML files. While I write code I use comments wherever I can, so that I don't have any problems to understand the code later. In this small example I will show you how you can add comments to a XML file with XmlTextWriter.
To add comments use the function WriteComment(). You can simple pass the comment as a string and the XmlTextWriter will convert it automatically to . Nice heh? And here is the generated xml file.
Partners
Dream.In.Code dotNet Slackers dotNet Spider Your HTML Source VisualBuilder.com DevGuru Planet Source Code ZVON.ORG Web Design ASPAlliance XML Pitstop Scripts
The Spot 4 SAP Bitshop Web Hosting