Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XSL: Checking for "No Node that matches criteria"

Status
Not open for further replies.

JoeMcGarvey

Programmer
Oct 31, 2002
47
US
I have a for-each statement that looks for certain parameters in the node set (namely an empty value for "Points"). If the next list item value for "Points" is empty, it displays that record asking for a value for "Points".

XSL:
<xsl:for-each select=&quot;//entity[@id='Statistics']/contents/entity[@type='listitem'][child::points='']&quot;>

... provide a value for points

</xsl:for-each>

XML:
<entity type=&quot;list&quot; id=&quot;Statistics&quot;>
<contents>
<entity type=&quot;listitem&quot;>
<Points>23</Points>
</entity>
<entity type=&quot;listitem&quot;>
<Points>15</Points>
</entity>
<entity type=&quot;listitem&quot;>
<Points></Points>
</entity>
</contents>
</entity>

The problem:

If all &quot;Points&quot; nodes in the list are defined and not null, then output a message saying &quot;No remaining statistics&quot;... but I don't know how to set the if statement since the for-each statement doesn't instantiate because it can't match the defined criteria.

Any ideas?
Joe McGarvey - Web Application Developer
Paragraph, Inc. - Paragraph Publisher -
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top