Hi,
I have a problem while using removeChild().
I have an XML file which I am updating with values. I need to delete the nodes which are not having values.
I have used removeChild() to remove the child. The child is removed, but it leavs the blank line. For example, when I delete the child a2 in the following example,
<Header>
<GMAHeader>
<Global>
<a1>test</a1>
<a2></a2>
</Global>
<Local>
<b1>test</b1>
<b2>test</b2>
</Local>
</GMAHeader>
</Header>
the result is as follows.
<Header>
<GMAHeader>
<Global>
<a1>value</a1>
</Global>
<Local>
<b1>value</b1>
<b2>value</b2>
</Local>
</GMAHeader>
</Header>
I have set preservespace(true) in outputFormt. If I dont use this, blank line is removed, but the XML format is not maintained. For example, when I dont use the "set Preservespace(true)", the file appears
as follows.
<Header> <GMAHeader><Global><a1>value</a1>
</Global><Local><b1>value</b1><b2>value</b2></Local>
</GMAHeader></Header>
Can anyone pls suggest what to do for this problem? I have been trying to solve this problem since 3-4 days and no use.
Pls help me.
Regards,
Gayathri.