R
R
Hello everybody.
I'm new to XML and I've got problem with one XPath query.
This is my situation:
<group>
<test required='1'></test>
<test required='1' noregexp='1'></test>
</group>
inside group there are few (usually from 10 to 20) test nodes.
if among all of the tests there is at least one node that doesn't have
"noregexp" attribute - like in the above example
I should call template for validating regexps.
well my idea was this:
if (count(required) != count(required and noregexp) ) { call template }
if counts varies that means there is a node that need to be validated
(at least one node)
in XPath:
<xsl:if test="count(*/@required='1' and */@noregexp='1') != count(*/@required='1')">
<!-- my template goes here -->
</xsl:if>
but this XPath query is incorrect and I don't know how to fix it
sorry for bothering but I'm just a newbie
thanks in advance for helping me with this query
best regards R
I'm new to XML and I've got problem with one XPath query.
This is my situation:
<group>
<test required='1'></test>
<test required='1' noregexp='1'></test>
</group>
inside group there are few (usually from 10 to 20) test nodes.
if among all of the tests there is at least one node that doesn't have
"noregexp" attribute - like in the above example
I should call template for validating regexps.
well my idea was this:
if (count(required) != count(required and noregexp) ) { call template }
if counts varies that means there is a node that need to be validated
(at least one node)
in XPath:
<xsl:if test="count(*/@required='1' and */@noregexp='1') != count(*/@required='1')">
<!-- my template goes here -->
</xsl:if>
but this XPath query is incorrect and I don't know how to fix it
sorry for bothering but I'm just a newbie
thanks in advance for helping me with this query
best regards R