xerces-c-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ss ak <ssa...@gmail.com>
Subject XML FORMAT TO A FILE
Date Fri, 31 Jul 2009 17:51:15 GMT
 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message