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

xslt node-set variable transversal

Subject: xslt node-set variable transversal
From: "Kyle Partridge" <kpartridge@xxxxxxxxxxxx>
Date: Tue, 30 Mar 2004 14:27:28 -0500
xslt node set
Hi,

This is probably an obvious question, but I still haven't been able to
get this to work.

I've got an xpath that narrows a set of all the regions in the document,
to the set of regions in a single "column":

<xsl:variable name="col-regions" select="//ws:region[parent::ws:regions
and @left&gt;0 and (@left+@width)&lt;$useable-page-width]"/>	

Then, I'm trying to iterate over that set:

<xsl:for-each select="$col-regions">
	<xsl:variable name="current-position" select="position()"/>	
	<xsl:apply-templates select="." mode="horizontal-region-block">
		<xsl:with-param name="following-regions"
select="$col-regions[position()&gt;=$current-position]"/>
		<xsl:with-param name="prev-region"
select="$col-regions[position()=$current-position-1]"/>
		<xsl:with-param name="top-adjust" select="$top-adjust"/>
	</xsl:apply-templates>
</xsl:for-each>

but this doesn't work - the XMLSpy debugger says I am not getting
anything in these params.

I have tried this with using $col-regions[etc....] (like above) to try
to get the following and preceding region or regions, and I have also
tried it using preceding-sibling with an enormous xpath expression
which, yet again, filters out regions that would not be in the current
column.  

Using preceding-sibling with an enormous xpath expression seems to work
- but I would rather not do an additional filtering every time I need to
find the prev or next region in the $col-regions list.  How come I can't
just reach back or forward one?

I am sure this is obvious but I just don't get it...I keep going back to
the books, but I still don't understand.

Thanks,
KP

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.