System.XML or Regex.Replace?
Posted
by cam
on Stack Overflow
See other posts from Stack Overflow
or by cam
Published on 2010-04-19T12:16:53Z
Indexed on
2010/04/19
12:23 UTC
Read the original article
Hit count: 306
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.
© Stack Overflow or respective owner