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

Re: Using a parameter in a select within a recursive

Subject: Re: Using a parameter in a select within a recursive template
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Sun, 19 Sep 2004 09:26:53 +0200
xpath select within select
Sean & Helen wrote:
<fo:block><xsl:value-of select="concat('FIELD_',$number)"/></fo:block>
...
However, the output gives me:
FIELD_1 FIELD_2 FIELD_3 etc....

Well, this is exactly what you tell the processor to produce: the *strings* FIELD_1, FIELD_2 etc.

rather than the data contained within these nodes.

You seem to assume the processor has to interpret the result of the expression concat('FIELD_',$number) as an XPath expression again, and act accordingly. This wont happen just because you find it convenient; the processor evaluates an expression once and only once.

If you want the processor to select elements with a
constructed name, you have to tell this to the processor
the right way: select all elements, and restrict to elements
which have the name you want. Translated into XPath:
 select="*[name()=concat('FIELD_',$number)]"

I suspect there are ways to simplify your style sheet
drastically.

J.Pietschmann

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.