XSLT beginner query



I have a few similar XML structures, which I want to be able to process properly in XSLT, so users can view online.


The first:



<TABLETYPE TYPEABBRV="MTHPRTSTS" TOTALINDICATOR="N">
<CATEGORY TYPE="DISABSTATUS" VALUE="WDIS" />
<STATUS>MET</STATUS>
</TABLETYPE>


The next:



<TABLETYPE TYPEABBRV="ELEMIDADNIND">
<STATUS>METADDIND</STATUS>
</TABLETYPE>


What I'd like to do is make sure when "STATUS" is displayed I don't get the value from both by checking for the existence of "CATEGORY". If "CATEGORY" exists, output one block of code. If not, a different block. I know I should use "xsl:choose" and "xsl:when" but can't figure out how to test if "CATEGORY" exists. Thank you in advance for viewing and answering.


No comments:

Post a Comment