M
Mike King
I believe this is a simple question. I need a XSLT file that removes
elements from a source file. I guess the tricky part is I need to use a
variable to indicate which element to preserve. In the example below, I want
to preserve the "/root/a[1]" element where "1" would be a variable. Can
anyone help me? I'm having the hardest time figuring out template rules.
#### Input ####
<?xml version="1.0" ?>
<root>
<a id="1">
<b id="1"/>
</a>
<a id="2">
<b id="2"/>
</a>
<a id="3">
<b id="3"/>
</a>
</root>
#### Output ####
<?xml version="1.0" ?>
<root>
<a id="1">
<b id="1"/>
</a>
</root>
elements from a source file. I guess the tricky part is I need to use a
variable to indicate which element to preserve. In the example below, I want
to preserve the "/root/a[1]" element where "1" would be a variable. Can
anyone help me? I'm having the hardest time figuring out template rules.
#### Input ####
<?xml version="1.0" ?>
<root>
<a id="1">
<b id="1"/>
</a>
<a id="2">
<b id="2"/>
</a>
<a id="3">
<b id="3"/>
</a>
</root>
#### Output ####
<?xml version="1.0" ?>
<root>
<a id="1">
<b id="1"/>
</a>
</root>