When using dbms_xmldom to manipulate an xmltype XML document, the result is automatically reformatted "prettily" with linefeeds injected into the xml after every tag pair. This may be ok when spaces are not important but for mixed content documents it is catastrophic.
For example - without any specific manipulation:
<blah>The dog said<something> hello </something>last week</blah>
the output becomes...
<blah>The dog said<something> hello </something>
last week</blah>
...which from a mixed content point of view is not the same at all.
So how can this pretty-izing" of the output be turned off?
There are 3 ways I can think of:
- Via schema - haven't tested this but I don't want a schema in my case
- Via definition in every xml instance using xml:space="preserve" - this definitely works but I would prefer not to have this in every document for reasons I won't go into here
- Via dbms_xmldom configuration (PHP equivalent: DOMDocument::preserveWhiteSpace=true) - I cannot find any way to achieve this!
Does anyone know of a dbms_xmldom method that exists to achieve this? eg. Something like dbms_xmldom.preserveWhiteSpace(MyDOMDocument,true)
Thanks in advance