xerces-c-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alberto Massari <amass...@datadirect.com>
Subject Re: XML FORMAT TO A FILE
Date Fri, 31 Jul 2009 18:00:25 GMT
It's not
 pSerializer->setNewLine(XMLUni::fgDOMWRTXercesPrettyPrint);
it's
 pSerializer->getDomConfig()->setParameter(XMLUni::fgDOMWRTXercesPrettyPrint, 
true);

Alberto

ss ak wrote:
>  I get the xml into the file as a SINGLE LINE...
> eg:
>
> <?xml version="1.0" encoding="UTF-8" standalone="no" ><personnel><person>
> TEST</person><email>TEST</email><email2222222><hello>TEST</hello></
> email2222222></personnel>
> what option/setting should i do to look in the form of XML
>
> <person>test</person>
> <email>test</email>
>
>
> DOMLSSerializer *pSerializer =
> ((DOMImplementationLS*)impl)->createLSSerializer();DOMLSOutput
> *theOutputDesc = ((DOMImplementationLS*)impl)->createLSOutput();
>
> pSerializer->setNewLine(XMLString::transcode("\n\r") );
>
> pSerializer->setNewLine(XMLUni::fgDOMWRTXercesPrettyPrint);
>
> XMLFormatTarget *myFormTarget = new LocalFileFormatTarget(X("outfile.xml"));
>
>
>  theOutputDesc->setByteStream(myFormTarget);
>
> theOutputDesc->setEncoding(L"UTF-8");
>
>  thanks,
> pSerializer->write(xmldoc, theOutputDesc);
>
>   


Mime
View raw message