I would think this should be easy, but I am relatively new to XSL stylesheets, and I can't figure out what I am doing wrong. Essentially, I only want to include branches that have a specific end node. For instance, I only want the branches that have the tag <TargetID>Default</TargetID>. Given this input:
<?xml version="1.0" encoding="UTF-8"?>
<wc:COLLECTION>
<AddedECN NAME="AddedECN" TYPE="Unknown" STATUS="0">
<ECNHeader>
<Number>ECN0000146</Number>
<TargetID>Oracle 11i</TargetID>
<TargetID>Oracle 11i New</TargetID>
<TargetID>Oracle 11i New 10-26</TargetID>
</ECNHeader>
</AddedECN>
<ChangedECN NAME="ChangedECN" TYPE="Unknown" STATUS="0">
</ChangedECN>
<UnchangedECN NAME="UnchangedECN" TYPE="Unknown" STATUS="0">
<ECNHeader>
<Number>ECN0000146</Number>
<TargetID>Default</TargetID>
</ECNHeader>
</UnchangedECN>
</wc:COLLECTION>
I am looking for this output:
<wc:COLLECTION>
<UnchangedECN NAME="UnchangedECN" TYPE="Unknown" STATUS="0">
<ECNHeader>
<Number>ECN0000146</Number>
<TargetID>Default</TargetID>
</ECNHeader>
</UnchangedECN>
</wc:COLLECTION>
The actual XML file has many more entries, of course. But a start would really help me.
Thanks!
<?xml version="1.0" encoding="UTF-8"?>
<wc:COLLECTION>
<AddedECN NAME="AddedECN" TYPE="Unknown" STATUS="0">
<ECNHeader>
<Number>ECN0000146</Number>
<TargetID>Oracle 11i</TargetID>
<TargetID>Oracle 11i New</TargetID>
<TargetID>Oracle 11i New 10-26</TargetID>
</ECNHeader>
</AddedECN>
<ChangedECN NAME="ChangedECN" TYPE="Unknown" STATUS="0">
</ChangedECN>
<UnchangedECN NAME="UnchangedECN" TYPE="Unknown" STATUS="0">
<ECNHeader>
<Number>ECN0000146</Number>
<TargetID>Default</TargetID>
</ECNHeader>
</UnchangedECN>
</wc:COLLECTION>
I am looking for this output:
<wc:COLLECTION>
<UnchangedECN NAME="UnchangedECN" TYPE="Unknown" STATUS="0">
<ECNHeader>
<Number>ECN0000146</Number>
<TargetID>Default</TargetID>
</ECNHeader>
</UnchangedECN>
</wc:COLLECTION>
The actual XML file has many more entries, of course. But a start would really help me.
Thanks!