FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Getting XML String Output with DTD and Declaration Attributes
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Getting XML String Output with DTD and Declaration Attributes [message #179413] Tue, 23 October 2012 12:17
Win User is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Placement & Work Solution provider
Next Topic: Setup help for PHP 64bit binaries
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 21 12:56:43 GMT 2024

Total time taken to generate the page: 0.02664 seconds