verbose layout and a host of parsers providing developers with ways to to play around with data in the Xml files.
Having said that some of the xml document nodes can run into multiple levels
of hierarchy and generating them using code can be tedious and annoying for the first time.
If you have been using XML DOM for creating these documents,then you would understand the pain
creating the XmlElements , managing the parent child links and finally creating the XmlDocument.
I would suggest that you have a look at using Linq to Xml for this purpose where the code is lot more
cleaner and if not 100% , you still are provided with some type of visual understanding of where you are
heading to.Life is a lot more easier this way.
Imagine yourself having to create the document below using Xml Dom Syntax.
We did not have may choices before and hence this approach was good but with Linq you will find that
such document creation is quite easy.In this sample I am reading/creating Xml documents using Xml DOM as well as Linq.
The code you feel is easy to manage/understand is entirely for you to decide.
Just focus on 2 functions in the code CreateXMLDOM() and CreateXMLLinq().
The whole source and support files are included in the zip
No comments:
Post a Comment