I have some XML that I want to transform to some XML:
I want to copy elements where 'triggerExclusi on' is not the text of its grandchild subelement. In this example I want to copy the second element, not the first.
This doesn't work for me:
My Saxon warns that a sequence can't be the first argument of the eq operator, and, I guess, only looks at the first grandchild.
Please, how do I select elements where a descendent of arbitrary depth has some value?
TIA
Code:
<element>
<child>
<grandchild>
otherWord
</grandchild>
<grandchild>
triggerExclusion
</grandchild>
</child>
</element>
<element>
<child>
<grandchild>
otherWord
</grandchild>
</child>
</element>
This doesn't work for me:
Code:
<template match="element[not(child/grandchild eq 'triggerExclusion')"]>
<copy>
<apply-templates/>
</copy>
</template>
Please, how do I select elements where a descendent of arbitrary depth has some value?
TIA
Comment