Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] sequence of strings

From: Florent Georges <lists@------------>
To:
Date: 12/2/2008 3:33:00 PM
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/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent