XML : xsl template to remove entire node if it has empty attributes

I have an XML that has multiple parent nodes and each node has different attributes. In addition I have few empty child nodes to these parent nodes and few empty headers i.e only parent node with attributes but no children.

I want to format it in such a way that my output XML will have no node with empty attribute i.e need an xsl template that deletes entire node If it enconters an empty attribute.

I have applied a template; that was able to remove only empty attributes but not the node that holds empty attribute. Also, when I tried to remove empty headers , it is deleting my empty child nodes too which I don't want!

So, I just need a template that deletes the node itself which holds an empty attribute.

No comments:

Post a Comment