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

Re: Inserting a separator only between non-empty strin

Subject: Re: Inserting a separator only between non-empty strings (XSLT 2)
From: Yves Forkl <Y.Forkl@xxxxxx>
Date: Fri, 18 May 2007 13:00:55 +0200
Re:  Inserting a separator only between non-empty strin
Thank you very much for your explanation, Michael. Now I understand better why things have to be this way.

The solution you suggested works perfectly for me. I am just a bit disappointed that XSLT 2 doesn't provide with me a more elegant construct that would make life even easier for me (like XSLT 2 already did in a lot of cases). :-)


mozer wrote:
and what about that ?

<xsl:variable name="concat">
<xsl:sequence>
 <xsl:value-of select="$a"/>
 <xsl:value-of select="$b"/>
 <xsl:value-of select="$c"/>
</xsl:sequence>
</xsl:variable>
<xsl:value-of separator="|" select="$concat[string-length(.) gt 0]"/>

Unfortunately, this won't work, as xsl:sequence only allows to use the select attribute here, not its element content. However, adapting it a little I get


<xsl:variable name="concat" select="($a, $b, $c)"/>
<xsl:value-of separator="|" select="$concat[string-length(.) gt 0]"/>

which seems to work (but I am not sure). Anyway, I prefer Michael's solution.

Yves

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.