More of an XPATH question actually:
When I'm applying XSLT templates to particular nodes, is there anyway I can select an element based on the existance of a child element?
For example:
I want to pick the middle <elem> element. If there was two <elem> elements with <child/> present, you can pick one at random (I assume first or last would be easiest).
I don't want to use select="root/elem[last()]" since that would pick the last one. Obviously I can't use "root/elem[0]" either.
Is there anyway I can do this?
When I'm applying XSLT templates to particular nodes, is there anyway I can select an element based on the existance of a child element?
For example:
Code:
<root>
<elem>
</elem>
<elem>
<child/>
</elem>
<elem>
</elem>
</root>
I don't want to use select="root/elem[last()]" since that would pick the last one. Obviously I can't use "root/elem[0]" either.
Is there anyway I can do this?