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

Re:

Subject: Re:
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Thu, 09 May 2002 14:54:14 +0200
 Re:
<xsl:param name="cols" select="3"/>

<!-- Selects the ART-elements, which are at the beginning of a row. -->
<xsl:template match="ARTS">
<table border="1">
<xsl:apply-templates select="ART[position() mod $cols = 1]" mode="row"/>
</table>
</xsl:template>


<!-- Selects the first ART of a row and the rest in this row. -->
<xsl:template match="ART" mode="row">
<tr>
<xsl:apply-templates select=". | following-sibling::ART[position() &lt; $cols]" mode="cell"/>
</tr>
</xsl:template>


<!-- Add the cells. -->
<xsl:template match="ART" mode="cell">
  <td><xsl:value-of select="NAME"/></td>
</xsl:template>

Regards,

Joerg

Carlos schrieb:
If i have, i have writted bellow xml file, how can i present this file in
this form:
<tr><td>1</td><td>2</td><td>3</td></tr>
<tr><td>4</td><td>5</td><td>6</td></tr>

this is my intention:
to format the xml file in a html but only with 3 celds but x rows.
if i make a foreach i only know ,to writte i a celd, only one row, but i
want to writte in three celds.
is posible?
can anybody helps me?
thanks



############
XML FILE
############
<?xml version="1.0" encoding="UTF-8"?>
<ARTS>
    <ART>
        <NAME>1
        </NAME>
        <VALUE>11
        </VALUE>
    </ART>
    <ART>
        <NAME>2
        </NAME>
        <VALUE>22
        </VALUE>
    </ART>
    <ART>
        <NAME>3
        </NAME>
        <VALUE>33
        </VALUE>
    </ART>
    <ART>
        <NAME>4
        </NAME>
        <VALUE>44
        </VALUE>
    </ART>
    <ART>
        <NAME>5
        </NAME>
        <VALUE>55
        </VALUE>
    </ART>
    <ART>
        <NAME>6
        </NAME>
        <VALUE>66
        </VALUE>
    </ART>
    <ART>
        <NAME>7
        </NAME>
        <VALUE>77
        </VALUE>
    </ART>
    <ART>
        <NAME>8
        </NAME>
        <VALUE>88
        </VALUE>
    </ART>
</ARTS>


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


Current Thread
  • [no subject]
    • Carlos - Thu, 9 May 2002 04:50:07 -0400 (EDT)
      • Michael Kay - Thu, 9 May 2002 08:36:14 -0400 (EDT)
      • Joerg Heinicke - Thu, 9 May 2002 08:48:19 -0400 (EDT) <=

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-2013 All Rights Reserved.