[xml] Add newline character after each child node



Hi All,

Please let me know how to add a newline character after adding each child node using libxml2.

I use below command to add a child node.
xmlNewTextChild(a_node, NULL, (xmlChar *)"child", (xmlChar *)"tre");
but the resulting xml nodes will be continuous.

Current Output:
<root>
<child>tre</child>
<Name>bhanu</Name>
</root>

I want the output as below:
<root>
<child>tre</child>
<Name>bhanu</Name>
</root>

Awaiting your reply,

Thanks & Regards,
Bhanuprakash S

 

Get your FREE, LinuxWaves.com Email Now! --> http://www.LinuxWaves.com
Join Linux Discussions! --> http://Community.LinuxWaves.com


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