|
Subject: Re: [xsl] sequence of strings From: Florent Georges <lists@xxxxxxxxxxxx> Date: Tue, 2 Dec 2008 15:26:35 +0100 (CET) |
Ruud Grosmann wrote:
> > <xsl:sequence select="'BLD'[contains($string, 'bold')],
> > 'ITA'[contains($string, 'italic')]"/>
> Thank you for your answer. This I was looking for all the time: a
> way to create a sequence of string in the select of
> xsl:sequence. However, I don't understand completely what is going
> on in that select.
'BLD' selects a string
'BLD'[...] selects a string iff the predicate is true
'BLD'[contains($string, 'bold')] selects the string iff $string
contains 'bold'
This is another way to write:
if ( contains($string, 'bold') ) then 'BLD' else ()
BTW, if I remember well, your template returns only one string. If
it is the case, you can select only the first string to get the same
behaviour:
<xsl:sequence select="
('BLD'[contains($string, 'bold')],
'ITA'[contains($string, 'italic')])[1]"/>
Regards,
--
Florent Georges
http://www.fgeorges.org/
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] sequence of strings, Ruud Grosmann | Thread | Re: [xsl] sequence of strings, Ruud Grosmann |
| Re: [xsl] sequence of strings, Ruud Grosmann | Date | Re: [xsl] sequence of strings, Ruud Grosmann |
| Month |