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

Re: EXSLT

Subject: Re: EXSLT
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Fri, 9 May 2003 10:30:06 +0100
str concat
Hi Johan,

> I think the error message is clear. But according to
>
> http://www.exslt.org/str/index.html 
>
> the concat(node-set) should work with EXSLT. 
>
> Why Im trying with concat is that I need the string as a variable 
> and not in the output. 

You are trying to use the EXSLT extension function str:concat(), but
because you aren't using the prefix "str:" on your function call, you
are actually using the built-in function concat(). The built-in
function concat() concatenates the two-or-more strings that it is
passed as arguments. The extension function str:concat() from EXSLT
concatenates the values of the nodes in the node set that it is passed
as an argument.

You must declare the prefix for the extension function in the
<xsl:stylesheet> element:

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:str="http://exslt.org/strings"
                extension-element-prefixes="str">
  ...
</xsl:stylesheet>

and then call the function including the "str:" prefix:

<xsl:template match="*">
   <xsl:variable name="allnodename"
                 select="str:concat(ancestor-or-self::*)"/>
   ...
</xsl:template>

Note that this will only work with processors that support
str:concat() (4XSLT and libxslt). Also note that the call
"str:concat(ancestor-or-self::*)" will *not* give you a string
consisting of the *names* of all the ancestors of the current node,
but rather their values. To do get their names, you should use the code:

<xsl:template match="*">
   <xsl:variable name="allnodename">
     <xsl:for-each select="ancestor-or-self::*">
       <xsl:value-of select="name()" />
     </xsl:for-each>
   </xsl:variable>
   ...
</xsl:template>

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


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


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.