I am trying to develop an XSLT stylesheet which will transform an xml into another by keeping in view:
- By default the stylesheet should display nothing for each element (not even the text).
- If there is an explicit template match for an element, then copy that element, it’s attributes and all its sub-elements (and their attributes).
In other words, identity transform only the elements explicitly specified.
Well, to do nothing for most, surely something like:
Then add matches for what you do want:
However, it seems like a very unusual requirement. Normally you simply use matches that navigate to the known content through knowledge of the xml.