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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XSLT: How to do a If / Else in XSLT?

Status
Not open for further replies.

SgtPeppa

Programmer
Jul 7, 2003
154
DE
Hey all, I have a question concerning XSLT. I have a xml document containing a couple nodes. I now need to know if the value of one node is not 0 or null, perform some other xslt or if the value is 0 or null perform some other xslt.

Anyone has some Idea?

Heres the structure of my xml:
<result>
<id>1234</id>
<name>testname</name>
<value>0</value>
</result>
And thats what I have up till now with my XSLT:

<?xml version=&quot;1.0&quot;?>
<xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot; <xsl:template match=&quot;result&quot;>
<HTML>
<HEAD>
<TITLE> </HEAD>
<BODY>
//this is where I need to do the If / else
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>

Thanx in advance,


Stephan
 
Ok found a solution using Choose and when

Thanx anyways,

Stephan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top