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

Re: Attribute "separator" of xsl:value-of in XSLT 2.0

Subject: Re: Attribute "separator" of xsl:value-of in XSLT 2.0
From: Andrew Welch <andrew.j.welch@xxxxxxxxx>
Date: Mon, 9 May 2011 12:10:38 +0100
Re:  Attribute "separator" of xsl:value-of in XSLT 2.0
> <author>
>  <first>Priscilla</first>
>  <last>Walmsley</last>
> </author>

> <xsl:value-of select="author" separator=" "/>

Here you select a sequence of one item, so there is nothing to join.

> <xsl:value-of select="author/first,author/last"/>
> produces
> 'Priscilla Walmsley'.

Here you select a sequence of 2 items, which are joined using the
default separator of a space.

The reason is xsl:value-of only ever adds a single text node to the
result tree, but its select attribute can return a sequence of
multiple items, so the separator is used to join the string value of
the items into a single string (just like string-join())

Andrew Welch

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.