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

Re: Hopefully not a terribly silly question

Subject: Re: Hopefully not a terribly silly question
From: Francis Norton <francis@xxxxxxxxxxx>
Date: Thu, 03 Jan 2002 18:27:40 +0000
morgan goeller
Hi Morgan,

Morgan Goeller wrote:

Unfortunately, I get a the literal string result of the concat() function, instead of the actual data value. Is there some sort of eval() function that I need to use? Am I approaching this incorrectly?

No, you don't need an eval() function (except in your approach) so yes, you are approaching it incorrectly - but you're very nearly there.

The following does what you want:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output indent="yes"/>
<xsl:template match="/">
<xsl:for-each select="/result/row">
<xsl:for-each select="./column">
<xsl:call-template name="print_name"/>
<xsl:template name="print_name">
<xsl:when test="@name">Name = <xsl:value-of select="@name"/>
<xsl:variable name="p" select="position()" />
Name <xsl:value-of select="position()"/>= <xsl:value-of select="/result/row[1]/column[position() = $p]/@name"/>
Value <xsl:value-of select="position()"/>=<xsl:value-of select="."/>

as you can see, the main difference is that I've replaced your attempt to concat() and (implictly) eval() a dynamic (and therefore illegal) XPath expression by a static XPath expression which gets its dynamic value from a variable. In fact you could also use


though this is slghtly less clear.

Hope this helps -


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list

Current Thread


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.
First Name
Last Name
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.