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

Conditional Formating

Subject: Conditional Formating
From: David Vogt <dvogt@xxxxxxxxxxxxx>
Date: Tue, 2 Jan 2001 12:00:26 -0600
conditional formating
I need to do some conditional formatting.
I'm a couple apply-templates deep into the tree.  At that point, within the
test of a choose/when, I'd like to reference a attribute of the root of the
tree, or a element off of the root of the tree, or something else that would
be better.

so, my xml might look like this:

<CALENDAR MYFORMAT="WEEK">
 <MYFORMAT>WEEK</MYFORMAT>
 <MONTHS>
  <MONTH>
  </MONTH>
  <MONTH>
  </MONTH>
  ...
 </MONTHS>
</CALENDAR>

I'd like to have some xsl like this but it's not referencing the value of
the MYFORMAT correctly.

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="html"/>

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

<xsl:template match="text()|@*"><xsl:value-of select="."/></xsl:template>

<xsl:template match="/">

<xsl:apply-templates/>

<xsl:template match="CALENDAR">
 <xsl:apply-templates select="MONTHS">
 </xsl:apply-templates>
</xsl:template>

<xsl:template match="MONTHS">
 <xsl:apply templates select="MONTH">
 </xsl:apply-templates>
</xsl:template>

<xsl:template match="MONTH">
 <xsl:choose>
  <xsl:when test="MYFORMAT='WEEK'">
   <td>You selected myformat of type week.</td>
  </xsl:when>
 </xsl:choose>
</xsl:template>

Basically, how do I get the xsl:when test=... to work???

Thanks,
Dave

Mark Your Calendar! 
SilverSummit 2001, April 8-12, Walt Disney World Dolphin Hotel 
<http://www.silverstream.com/userconference>> 
SILVERSTREAM's eBUSINESS PLATFORM in action: Visit:
<http://www.CivicLife.com> 
This solution realizes the vision of a "Citizen-Centric Civic World" by
harnessing the Internet 
to enable personal, real-time interactions between citizens and their civic
institutions. 
To learn more about this and other SilverStream eBusiness solutions visit: 
<http://www.silverstream.com/customers>> 



 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.