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

Re: grouping + global variable (?) (was re: regexs,

Subject: Re: grouping + global variable (?) (was re: regexs,
From: Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx>
Date: Thu, 12 Aug 2004 18:07:56 -0400
xsl how variabl element
Thanks Wendell,

On Aug 12, 2004, at 5:29 PM, Wendell Piez wrote:

2. Extended XSLT 1.0: create your first result by applying templates to your source and binding the results to a variable, which you then use a processor extension to turn into a node set for further processing. You'll probably need modes (if only to keep yourself sane), so:

<xsl:variable name="intermediate-result">
  <xsl:apply-templates select="/" mode="pass1"/>
</xsl:variable>

<xsl:template match="/">
<xsl:apply-templates select="exslt:node-set($intermediate-result)" mode="pass2"/>
</xsl:template>


<xsl:template match="/" mode="pass1">
  <xsl:apply-templates select="pass1"/>
</xsl:template>

where exslt:node-set is an extension function that creates a node-set from a result-tree-fragment (see exslt.org or consult your processor's documentation).

3. XSLT 2.0 -- same as 2, except no extension function is needed: it'll happen transparently.

I'm using XSLT 2.0; therefore, let me see if the light is dawning:


My pass1 mode is going to create an exact copy of the source bibliographic collection, with the only difference being that the year strings get the proper suffix appended.

Then when I run the second pass through my template that says has <xsl:value-of select="$year"/> I end up with the original year plus the suffix.

Is that the idea?

I had gotten confused because I was thinking that somehow I'd be creating an element or attribute with, say, the generated suffix, and accessing those with some sort of xpath expression; e.g. <xsl:value-of select="$biblist//mods[@id=$thisid]/suffix"/>.

That's the wrong way to think about it; correct?

Bruce

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.