C
coconet
I have a DataTable with many rows. I use WriteXml to emit to an
XmlWriter with an underlying StringWriter to put the final output into
a string.
I need to massage the XML output now. I don't know if it should be
done while the data is in the DataTable, during the XmlWriter writing
phase or after the information is in a string. I definitely don't want
to put the whole thing into an XML DOM instance because the XML is
currently 300mb in size.
The data looks like this:
<item>
<code>aaaa</code>
<info>bbbb</info>
<info2>cccc</info2>
</item>
For every "info2" element, I need to add these two sub-elements
(currently hardcoded):
<p:testbegin>2007-12-12T15:00:00</p:testbegin>
<p:testend>2007-12-13T15:00:00</p:testend>
I would also like to add a custom namespace to the final XML document
so instead of "code" I would like to have "p:code", and "p:info"
instead of "info", but I do not want to change "info2".
What is the best way to transform this from its DataTable origin?
Thanks.
XmlWriter with an underlying StringWriter to put the final output into
a string.
I need to massage the XML output now. I don't know if it should be
done while the data is in the DataTable, during the XmlWriter writing
phase or after the information is in a string. I definitely don't want
to put the whole thing into an XML DOM instance because the XML is
currently 300mb in size.
The data looks like this:
<item>
<code>aaaa</code>
<info>bbbb</info>
<info2>cccc</info2>
</item>
For every "info2" element, I need to add these two sub-elements
(currently hardcoded):
<p:testbegin>2007-12-12T15:00:00</p:testbegin>
<p:testend>2007-12-13T15:00:00</p:testend>
I would also like to add a custom namespace to the final XML document
so instead of "code" I would like to have "p:code", and "p:info"
instead of "info", but I do not want to change "info2".
What is the best way to transform this from its DataTable origin?
Thanks.