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

RE: xslt node-set variable transversal

Subject: RE: xslt node-set variable transversal
From: "Andreas L. Delmelle" <a_l.delmelle@xxxxxxxxxx>
Date: Tue, 30 Mar 2004 22:46:02 +0200
xsl node
> -----Original Message-----
> From: Kyle Partridge [mailto:kpartridge@xxxxxxxxxxxx]
>
> 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:
<snip />
>
> but this doesn't work - the XMLSpy debugger says I am not getting
> anything in these params.
>

Hi,

I'm unsure what kind of solution is appropriate, mainly because we don't get
to see what actually happens inside the 'horizontal-region-block' mode
template.

However, there seems to be something rather awkward about the structure

<xsl:for-each select="$nodes">
  ...
  <xsl:apply-templates select="." mode="different-mode">
    <xsl:with-param name="pprec" select="preceding-sibling::*" />
    <xsl:with-param name="pfoll" select="following-sibling::*" />
  </xsl:apply-templates>

</xsl:for-each>

which seems more or less what you're trying to do.

The reason for my thinking so is the fact that the preceding- and
following-sibling axes will *per se* be available from within the matching
template, since the context node will be changed by the
apply-templates --I'm absolutely dazzled as to why you would want to pass
these in as parameters...

The above just needs to become:
<xsl:apply-templates select="$nodes">
  <xsl:with-param name="pparam" select="expr" />
</xsl:apply-templates>

where the param is used to collect data which is easily accessible from the
context surrounding the apply-templates, but won't be too easily reachable
from within the context of the matching template.


Hope this gives you an idea (or two)!

Cheers,

Andreas

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.