Removing unwanted nodes

magdaaortagaa

New Member
My question is similar to this. However I want to remove the empty nodes, under "t" element only. Also nodes should be removed if its child nodes do not have any value.My input xml\[code\]<r><j></j><k>sample</k><t> <a>1</a> <a>2</a> <b><c/></b> <d>1</d> <d>15</d> <e x="1"/> <h y="" /> <f>foo</f></t></r>\[/code\]output expected\[code\]<r><j></j><k>sample</k><t> <a>1</a> <a>2</a> <d>1</d> <d>15</d> <e x="1"/> <f>foo</f></t></r>\[/code\]
 
Back
Top