[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XSL If Statement - Repost

Subject: RE: XSL If Statement - Repost
From: sumit patki <sumitpatki@xxxxxxxxxxx>
Date: Fri, 22 Aug 2008 14:42:30 +0000
RE:  XSL If Statement - Repost
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.