Re: [xml] =?utf-8?q?How_to_add_newlines_to_output=3F?=



Thanks for the replies.

I was already doing the indent on saving, that isn't the issue.

I had already tried adding a text node.  First I tried:
xmlNewTextChild(newVersion, NULL, (xmlChar *)"", (xmlChar *)"\n");
That does insert the newline, but also gives me <> which I don't want.

Then I tried xmlTextConcat(newVersion, (xmlChar *)"\n", 1);  And different variants, and that didn't appear to insert any text or newlines.

So, what API do you use to add the new text nodes to insert the \n characters so that the human readable formatting of the xml file looks like:

<root>
 <record id="1">
 <child1>Data</child1>
 <child2>Data</child2>
 </record>
<record id="2">
<child1>Data</child>
<child2>Data</child>
</record>
</root>

Once I know exactly what API to use to add the /n and not get the <> then I should be set.

Thanks,
Burt



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]