[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: constantin.vasiliu@xxxxxxxxxxxxxx
Date: Fri, 31 Oct 2003 11:32:53 -0800
constant in xsl

> 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?

> You can't store anything in XSLT - it's a side-effect-free 
> language; and
> there is no concept of "previous" - it's not a sequential execution
> model. 
Thanks a bunch! None of the books I looked at spelled that out explicitly.
At least I'm not chasing a chimera any longer.

> That shouldn't be necessary. I can't follow your code below
I don't blame you: can't figure out much without seeing the input tree.

> 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"). Also, "conditions" need to contain an "xsl:for-each". Is that

Many thanks,

Constantin Vasiliu

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

Current Thread


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.
First Name
Last Name
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.