04-20-2020 08:04 AM
Is it possible to get the XML string from a DOM reference without the "<?xml ... ?>" node at the beginning? I'm having to manually remove the XML declaration using a Match Pattern function, which seems tedious and unnecessary. I'm guessing there is no way to do this, as the parser just does what it does. But perhaps there is a DOM property for this?
The attached example implements the following test code:
And gives the following result:
You can see that the intermediate result contains the XML declaration, which I then manually remove to get the output string equal to the input string.
Curiously, when you use Flatten to XML, the string does not contain the XML declaration.
Solved! Go to Solution.
04-20-2020 08:19 AM
Not entirely sure. but maybe like this?
Do close the document ref though.
04-20-2020 08:38 AM
Use the 1st Child property. 😉
04-21-2020 05:22 AM
Works like a champ!
Not immediately intuitive, but the solution is at least plainly within the XML API.
Thanks for the quick fix.