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

Re: exit <xsl:for-each> or change <xsl:variable>

Subject: Re: exit <xsl:for-each> or change <xsl:variable>
From: Matts Isuls <matts.isuls@xxxxxxxxxxx>
Date: Tue, 2 Apr 2002 11:43:15 +0300
xsl for each row cell
ok, 

Here is the actual problem. If the processor comes across a $next-table$
cell it should:

          <xsl:if test="(cell[1]/data)='$next-table$'">
            </table><table border="1">
          </xsl:if>

but that is not possible is it. Is there a way to do this? I would like to
end the current table and start a new one when the value '$next-table$'
shows up.
  
Matts Isuls

-------------------
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:template match="/">
  <html>
   <table border="1">
    <xsl:for-each select="/root/table/row">
     <xsl:if test="(cell[1]/data)='$next-table$'">
      <!-- </table><table border="1"> -->
     </xsl:if>
     <tr>
      <xsl:for-each select="cell">
       <td> 
        <xsl:value-of select="data"/>
       </td>
      </xsl:for-each>
     </tr>
    </xsl:for-each>
   </table>
  </html>    
 </xsl:template>
</xsl:stylesheet>
-------------------

-------------------
<?xml version="1.0"?>
<root>
<table>
 <row>
  <cell><data>r1c1</data></cell>
  <cell><data>r1c2</data></cell>
  <cell><data>r1c3</data></cell>
  <cell><data>r1c4</data></cell>
 </row>
 <row>
  <cell><data>r2c1</data></cell>
  <cell><data>r2c2</data></cell>
  <cell><data>r2c3</data></cell>
  <cell><data>r2c4</data></cell>
 </row>
 <row>
  <cell><data>r3c1</data></cell>
  <cell><data>r3c2</data></cell>
  <cell><data>r3c3</data></cell>
  <cell><data>r3c4</data></cell>
 </row>
 <row>
  <cell><data>$next-table$</data></cell>
  <cell><data></data></cell>
  <cell><data></data></cell>
  <cell><data></data></cell>
 </row>
 <row>
  <cell><data>r1c1</data></cell>
  <cell><data>r1c2</data></cell>
  <cell><data>r1c3</data></cell>
  <cell><data>r1c4</data></cell>
  <cell><data>r1c5</data></cell>
 </row>
 <row>
  <cell><data>r2c1</data></cell>
  <cell><data>r2c2</data></cell>
  <cell><data>r2c3</data></cell>
  <cell><data>r2c4</data></cell>
  <cell><data>r2c5</data></cell>
 </row>
</table>
</root>
-------------------

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.