xsl-list
[Top] [All Lists]

Printing a value if an attribute does not exist

2004-08-23 20:04:11




How do you check for the existence of an attribute?

<TIER>
   <REGION NAME="CT">89</REGION>
   <REGION NAME="MD">135</REGION>
</TIER>

What I want to say is:

If region[(_at_)name="VA"] exists
   print value of region[(_at_)name="VA"]
else
   print "0.0"

It is also possible that there will be no REGION elements

<TIER>
</TIER>

I would still want to say:

If region[(_at_)name="VA"] exists
   print value of region[(_at_)name="VA"]
else
   print "0.0"

Thanks

Mike





<Prev in Thread] Current Thread [Next in Thread>