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

Re: How Can I Reference previous XML in Subsequent It

Subject: Re: How Can I Reference previous XML in Subsequent Iterations?
From: "Chris M." <chris@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 18 Apr 2007 11:52:39 -0400
Re:  How Can I Reference previous XML in Subsequent  It
Well, here we have a node-set, not the layout in the original XML. In this case, it is the same, and crucial to the output.

I found out the hard way that a sorted node-set is not iterated in the sorted order, but the order in the original predicate. I am also limited to using XPath 1.0 (the libxslt implementation used in PHP 5), so I miss out on some very nice XPath 2.0 functions).

I now sort the original XML and eschew sorting in the stylesheet.

I'm always up for learning new ways of thinking, which is why I'm posting here, and risking being branded a n00b (a state which seldom lasts long for me).

On Apr 18, 2007, at 11:44 AM, David Carlisle wrote:


The main issues I have with the way XSLT
works is with the way states change all the time. For example, if I
want to compare a value to the value of the previous iteration in an
xsl:for-each loop,

The way that is phrased shows that you haven't really absorbed the xslt
processing model. there is no assumption that the nodes selected by the
select statement in a xsl:for-each are processed in any order. They can
be processed in any order, and in particular they can be processed in
parallel. thus the fact that you can not copy state changes from one
iteration to another is not some arbitrary restriction on the language,
it is just a natural consequence of the processing model.


David


Chris Marshall
chris at getridofthiswholelongthingybecauseitstoconfusescrapers littlegreenviper dot com
http://www.cmarshall.net/


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.