xsl-list
[Top] [All Lists]

RE: [xsl] XSL If Statement - Repost

2008-08-22 09:42:57

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
--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

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