RE: [xsl] XSL If Statement - Repost

Subject: RE: [xsl] XSL If Statement - Repost
From: sumit patki <sumitpatki@xxxxxxxxxxx>
Date: Fri, 22 Aug 2008 14:42:30 +0000
Hi David,
The Matrix tag is present only once in the XML. So is there any way I can
avoid the outer for-each loop:
xsl:for-each select="topic/detail"

I tried xsl:if test="topic/detail/matrix=1" but it didn't work.

I guess if I can eliminate the outer for-each loop, it might solve the
problem.

I want to write something like below:

xsl:if test="topic/detail/matrix=1"
   table border="2"
   xsl:for-each select="topic/detail/table/state
      tr
            td STYLE="font-weight: bold;vertical-align: top;"> xsl:value-of
select="statename"
            td STYLE="vertical-align: top;"> xsl:value-of select="statedesc"
      tr

The xml looks like below:
topic>
      detail>
              matrix>1
              table>
	    state>
	         statename>
                         statedesc>

Please note that Table and matrix tags are grand children of detail, state is
child of table and repeats many times in the xml. Matrix tag appears only
once.


P.S. - When I give the actual XSLT code in Plain text, for some reason nobody
can see the code in the posted email.
_________________________________________________________________
Searching for the best deals on travel? Visit MSN Travel.
http://msn.coxandkings.co.in/cnk/cnk.do

Current Thread