XML DOMDocument output not encoding quotes

arnz

New Member
I seem to be in a no man's land with the xml I'm working on. I have to meet a third-party format which has one section formatted like this:\[code\]<description> big red <name>'ball'</name></description>\[/code\]In the above example using $dom->saveXML() to output the xml results with the single quotes still being unencoded (likewise for double quotes). Leaving single or double quotes unencoded will throw an error in some of my clients' systems.SimpleXML, on the other hand, will allow me to output the encoded quotes, but I haven't been able to figure out how to create a node that both has a text value and children. Meaning, updating the text removes the child and, attempting to re-add the child removes the text.I've been banging my head on this for a while so any help is appreciated.
 
Back
Top