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

RE: XML to HTML: How to make decisions based on what h

Subject: RE: XML to HTML: How to make decisions based on what has been displayed
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Fri, 31 Oct 2003 23:10:49 -0000
how to make decisions
> 
> > This shouldn't matter. position() calculates the position of
> > the current
> > node within the current node list, which is the list of 
> nodes selected
> > using <xsl:apply-templates> or <xsl:for-each>. So long as you 
> > select the
> > nodes to be included using one of those instructions (and not, for
> > example, by selected a larger set of nodes and then 
> selecting a subset
> > using xsl:if or xsl:choose) the position() should be set correctly.
> 
> Thanks for your answer, Michael. Actually, I'm doing exactly what you
> describe: I select a larger set of nodes, then selecting a 
> subset with xsl:if. So we're back to the original question: 
> is there any way to alternate the row color given that 
> position() won't help me much?

Try to restructure it so you select the subset using xsl:for-each.

Instead of 

<xsl:for-each select="x">
  <xsl:if test="c">
    <tr>

do

<xsl:for-each select="x[c]">
  <tr>

> 
> 
> > should be doing something like:
> > 
> > <xsl:value-of select="name(element[.//*[conditions]][1])"/>
> 
> Can you explain more on this? Should "element" stay as such 
> or be replaced with the real name of the element I'm looking 
> for (which turns out to be "Sequence").

This was intended as pseudo-code. Substitute the right things for
"element" and "conditions".

 Also, "conditions" 
> need to contain an "xsl:for-each". Is that possible?

No, it's not possible, but are you really sure it is necessary?

Michael Kay


 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.