Correction: you want to set XMLUni::fgDOMWRTFormatPrettyPrint; the
XMLUni::fgDOMWRTXercesPrettyPrint simply control the extra new line
inserted between top level elements.
Alberto
Alberto Massari wrote:
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);