Home »
Imported messages »
comp.lang.php »
Getting XML String Output with DTD and Declaration Attributes
Getting XML String Output with DTD and Declaration Attributes [message #179413] |
Tue, 23 October 2012 12:17 |
Win User
Messages: 1 Registered: October 2012
Karma: 0
|
Junior Member |
|
|
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.
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
through this?
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
|
|
|
Goto Forum:
Current Time: Tue Dec 03 19:23:08 GMT 2024
Total time taken to generate the page: 0.02718 seconds