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 Tinny Ng <tn...@ca.ibm.com> on 2003/01/07 19:23:41 UTC

Re: What is the best way to write a XML DOM tree to a file with all indentation?

Igor,

Your code seems to be ok.   But Xerces-C++ 2.1.0 didn't implement the
formatPrettyPrint feature with indentation.

Such implementation has been changed in the current development code.   Now
the formatPrettyPrint feature prints indentation and newline.   Please try
again with the latest nightly build
(http://xml.apache.org/dist/xerces-c/nightly/) see if it got printed
"prettier".

Tinny


----- Original Message -----
From: "Shtilkind, Igor" <SH...@northropgrumman.com>
To: <xe...@xml.apache.org>
Sent: Monday, January 06, 2003 3:28 PM
Subject: What is the best way to write a XML DOM tree to a file with all
indentation?


> Hi all,
> What is the best way to write a XML DOM tree to a file with all
indentation?
> I use
> bool formatPrettyPrint = true;
> if (theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint,
> formatPrettyPrint))
> theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint,
> formatPrettyPrint);
> XMLFormatTarget *myFormTarget = new StdOutFormatTarget();
> theSerializer->writeNode(myFormTarget, *doc);
> XMLCh* source = theSerializer->writeToString(*doc);
>
> I tried to search the e-mail archives but <http://archive.covalent.net> is
> not available. Are there other Xerces-C references available besides
> downloaded samples?
> Thanks,
>
> Savely
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org