xerces-c-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ss ak <ssa...@gmail.com>
Subject Re: XML FORMAT TO A FILE
Date Fri, 31 Jul 2009 19:17:16 GMT
can u explain a little more than this...

simply control the extra new line inserted ...how do i control them???

On Fri, Jul 31, 2009 at 11:03 AM, Alberto Massari
<amassari@datadirect.com>wrote:

> 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);
>>>
>>>
>>>
>>
>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message