» Imported messages
» Getting XML String Output with DTD and Declaration Attributes
|Getting XML String Output with DTD and Declaration Attributes [message #179413]
||Tue, 23 October 2012 08:17
I am using DOMDocument class to build XML.|
I obtained the DOMDocument by instantiating an implementation class with DTD,
then got the DOMDocument object from it.
But in using DOMDocument::saveXML() method to get string output, I am
disappointed in that output, and there seems to be no option (no configurable
property or method setting on DOMDocument class) to get what I want.
1. the 'encoding' and 'standalone' attributes in the output, inasmuch as I
specified them and validated the DTD against this already
2. I want the DOCTYPE specified in the output with the DTD I gave, inasmuch
as I specified it.
Before I try using XMLWriter class (and I am not sure it works), I am
wondering if there is an easy way out of this. If I have to use XMLWriter,
what is best approach of running either the DOMDocument or the string output
If XMLWriter object is what I need, the PHP documentation on XMLWriter class
"simple usage" or "quick guide" is non-existent (although methods features
are documented), and a Google search shows specific uses by others unrelated
to my particular problem.
ver PHP 5.4.8
Current Time: Sat Dec 16 06:17:46 EST 2017
Total time taken to generate the page: 0.00699 seconds