You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Gareth Reakes <ga...@decisionsoft.com> on 2003/02/21 09:43:41 UTC
XML declaration
Forwarded for Srikanth.
Once I used the 1.0 in the setversion() function it is
working fine. But I am interested in displaying the
XML declaration node in the file along with the XML
tree builded in my application. I am using the
following piece of code to write the xml content into
the file. But this is not printing the XML declaration
even after setting SetVersion ,SetEncodingName,SetStandAlone
after creation of the XML document.
DOMImplementation *impl =
DOMImplementationRegistry::getDOMImplementation(tempStr);
DOMWriter *theSerializer =
((DOMImplementationLS*)impl)->createDOMWriter();
// plug in user's own error
handler
DOMErrorHandler *myErrorHandler = new
DOMPrintErrorHandler();
theSerializer->setErrorHandler(myErrorHandler);
theSerializer->setEncoding(X("UTF-8"));
XMLFormatTarget *myFormTarget = new
LocalFileFormatTarget(fileName.Data());
theSerializer->writeNode(myFormTarget,
*doc);
Can any body tell me how to get this XML declaration node
to be printed into the file.
Thanks & Regards,
Srikanth
--
Gareth Reakes, Head of Product Development +44-1865-203192
DecisionSoft Limited http://www.decisionsoft.com
XML Development and Services
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org