I’m generating a large amount of XML documents from a set of values in an Excel file. The only thing that changes for each XML document is the values. I figured the best way to generate these documents was to make a “XML skeleton” (since the XML format never changes) and then plug in symbols like “&%blahNameblahTest”, so then I could just preform a Regex.Replace on each value.
I will be handing over this project to another developer and I’m wondering if I should convert the project to generate the XML file manually everytime through the System.XML namespace.
The only advantages I see to this is ensuring that the XML document is valid.
The current method would be more readable than that method, and way faster since I’m generating around 1500 documents.
I would stick with your existing method.
However, I would add a reference to
System.Linq.XMLthough and do anXElement.Parse()on the output to ensure your resultant document parses correctly. (The one advantage you mentioned to the System.Xml route!)