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

Re: sequence of strings

Subject: Re: sequence of strings
From: Florent Georges <lists@xxxxxxxxxxxx>
Date: Tue, 2 Dec 2008 15:26:35 +0100 (CET)
Re:  sequence of strings
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

    <xsl:sequence select="
        ('BLD'[contains($string, 'bold')],
         'ITA'[contains($string, 'italic')])[1]"/>


Florent Georges

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.