XML Document Entity Replacement
-
Ok, this should be simple, but it doesn't seem to be. XmlDocument object in memory that contains something like:
<content>testing ' and " and ' and "</content>
After I build my document with appropriate nodes, and set the value of the content node (with entities), I need to extract the xml as a string. So far, every method I've used to extract the xml as a string converts the enties, so ' becomes ' and " becomes ". The vendor that I'm working with is expecting the entities, not the converted characters. ??
-
Ok, this should be simple, but it doesn't seem to be. XmlDocument object in memory that contains something like:
<content>testing ' and " and ' and "</content>
After I build my document with appropriate nodes, and set the value of the content node (with entities), I need to extract the xml as a string. So far, every method I've used to extract the xml as a string converts the enties, so ' becomes ' and " becomes ". The vendor that I'm working with is expecting the entities, not the converted characters. ??
You will need some how to replace the & character with & amp; This way the XmlDocument object will confuse and will translate the & amp; as & only. You will then have & amp;apos; in the memory, which should become & apos; when you get it. Hope it helps.