Thanks Gary and Kevin - that worked.
Hardy Merrill
>>> kevin.rodgers@xxxxxxx 10/22/04 05:08PM >>>
Gary Hegenbart writes:
> I'm not an expert, but you need to check to see if the node name
> starts with ERR. Assuming you are working in the 'user' node, you
can
> try this:
>
> <xsl:if test="count(./*[starts-with(name(), 'ERR')])>0">
> <!-- do something for an error node -->
> </xsl:if>
>
> It counts all child nodes whose name starts with ERR, the tests if
the
> count is greater than
Yes, but you don't need to count them. The set of nodes that satisfy
the condition is automatically converted to a boolean value; only an
empty set is considered to be false:
<xsl:if test="./*[starts-with(name(), 'ERR')]">
<!-- do something for a node with errors -->
</xsl:if>
http://www.w3.org/TR/xslt#section-Conditional-Processing-with-xsl:if
http://www.w3.org/TR/xpath#function-boolean
I'm not an expert either, so here's my followup question: what is the
point of specifying "./" in the above expression?
--
Kevin Rodgers
| Current Thread |
- easy one
- Hardy Merrill - Fri, 22 Oct 2004 14:28:15 -0400
- <Possible follow-ups>
- Hardy Merrill - Mon, 25 Oct 2004 08:12:43 -0400 <=
|
|