Hi Susanna,

unfortunately, there is no simple function in xerces-c to serialize or
print out a DOMDocument.

The only way I know is given by the DOMPrint example, which parses a XML -
File into a DOMDocument and afterwards prints the DOMDocument to the
standard output (cout). By the way, I have derived my application form this
base.

The sample CreateDOMDocument creates a new DOMDocument and fills it with
some elements. To print it out to a file you need the 'second half' of the
sample DOMPrint. Then change the output direction from cout to your file
stream.

I made an example, where I put together the both parts. You can test it in
the DOMPrint sample workspace. Don't forget to adapt the output file's name
in line180. And: The transcoder needs an encoding declaration in the
DOMDocument, which I put in by doc.createXMLDecl(...) in line 301.

(See attached file: DOMPrint.zip)

Bye, Andreas

DOMPrint.zip

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to