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

Trying to learn XSL

Subject: Trying to learn XSL
From: Tucker Williams <tucker@xxxxxxxxxxxx>
Date: Thu, 24 Feb 2000 18:04:39 -0600
tucker williams
I'm trying to play around with some XSL.  Someone else wrote this and I'm
trying to figure out how to change it to my liking.  What I want to do is
for every other table cell after the table header have the colors of the
table cell change every other cell.

Here's what I have so far:

<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"/>
<xsl:strip-space elements="*"/>
 
<xsl:template match="/">
  <html>
    <head><title>Incidents Currently Logged at Handango.com</title></head>
    <body>
      <xsl:apply-templates/>
    </body>
  </html>
</xsl:template>

<xsl:template match="/*">
  <table border='2'>
    <xsl:for-each select="*[position() = 1]/*">
      <th bgcolor='GRAY'>
        <xsl:value-of select="local-name()"/>
      </th>
    </xsl:for-each>

    <xsl:apply-templates/>

  </table>
</xsl:template>

<xsl:template match="/*/*">
  <tr>
    <xsl:apply-templates/>
  </tr>
</xsl:template>

<xsl:template match="/*/*/*">
  <td bgcolor="slateblue">
  <font color="wheat">
  </font>
  </td>
</xsl:template>

</xsl:stylesheet>


I'm wondering if I need a function to do this, something like:

<xsl:choose>
	<xsl:when expr="[position() mod 2] =1">
	some html
	</xsl:when>
	<xsl:when expr="[position() mod 2] =0">
	some html
	</xsl:when>
</xsl:choose>

Am I on the right track? Or have I derailed?

Any help is appreciated.


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