xsl-list
[Top] [All Lists]

[xsl] value-of w/separator and nodes

2007-02-02 10:19:49
Hi List,

What I understood from the value-of with the separator attribute set is that, for each item in the result set from the select attribute, xpath casting rules are applied, the separator string is appended and so on. I.e.:

<xsl:value-of select=" ('t', 'e', 's', 't') " separator="|" />

gives: t|e|s|t

When the values 't', 'e' etc, are returned from a function, it does not work anymore, unless I provide the function with a type 'xs:string' (or any other atomic type).

<xsl:value-of select="(for $i in 1 to 100 return my:test())" separator="|" />

   <xsl:function name="my:test" as="xs:anyAtomicType">
       <xsl:text>1</xsl:text>
   </xsl:function>

returns 1|1| etc, but:

<xsl:value-of select="(for $i in 1 to 100 return my:test())" separator="|" />

   <xsl:function name="my:test" >
       <xsl:text>1</xsl:text>
   </xsl:function>

returns 11111

I suspect it has to do with the result being a node() of type text. However, still the normal casting rules should apply to each item, not? Can someone clarify this a bit for me?

Cheers,
-- Abel Braaksma

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>