I need to know is there any nod" /> I need to know is there any nod" /> I need to know is there any nod"/>

XSLT - check attribute is exist or not

133 Views Asked by At

I'm new to XSLT. this may be a simple question,

example : XML

<doc>
   <sec id="sec_2" sec-type="norm-refs">
</doc>

I need to know is there any <sec> node containing attribute sec-type='node-refs', exist or not in original XML document.

1

There are 1 best solutions below

0
AudioBubble On BEST ANSWER

This is a simple XPath:

//sec[@type="norm-refs"]

The @ symbol indicates that you want an attribute that matches, not an element. The square brackets indicate you want something that matches that but the selector returns what comes before the square brackets.