G
Guest
Hi,
I have to make a formatted (indented) xml file like this :
<?xml version="1.0"?>
<Message>
<Parent index="0" length="6">123
<Child1 index="0,1" length="6">abcd</Child1>
<Child2 index="0,2" length="6">pqrsxyz</Child2>
</Parent>
</Message>
As you can see, <Parent> node has some innertext as well as child nodes.
But, if
I make xml like this the indentation is lost. The resultant xml is like
this :
<?xml version="1.0"?>
<Message>
<Parent index="0" length="6">123<Child1 index="0,1"
length="6">99</Child1><Child2 index="0,2" length="6">pqrsxyz</Child2></Parent>
</Message>
To sum up the problem, if a node has both innertext and some child nodes,
then the entire node is written in a single line, without indentation.
How can I get the indentation in the above case??
Any help is highly appreciated.
Thanks.
I have to make a formatted (indented) xml file like this :
<?xml version="1.0"?>
<Message>
<Parent index="0" length="6">123
<Child1 index="0,1" length="6">abcd</Child1>
<Child2 index="0,2" length="6">pqrsxyz</Child2>
</Parent>
</Message>
As you can see, <Parent> node has some innertext as well as child nodes.
But, if
I make xml like this the indentation is lost. The resultant xml is like
this :
<?xml version="1.0"?>
<Message>
<Parent index="0" length="6">123<Child1 index="0,1"
length="6">99</Child1><Child2 index="0,2" length="6">pqrsxyz</Child2></Parent>
</Message>
To sum up the problem, if a node has both innertext and some child nodes,
then the entire node is written in a single line, without indentation.
How can I get the indentation in the above case??
Any help is highly appreciated.
Thanks.