xsl-list
[Top] [All Lists]

Re: [xsl] passing a sequence as a parameter

2008-02-26 04:35:56
On 26/02/2008, Robert Walpole 
<robert(_dot_)walpole(_at_)devon(_dot_)gov(_dot_)uk> wrote:
Hi,

 I am looking for a way of working with a sequence passed to a stylesheet
 as a parameter. For example, I have an xml file as follows...

 <root>
    <user>
        <name>Robert</name>
        <name>Adam</name>
        <name>Graham</name>
    </user>
 </root>

 ...which I want to pass to my XSLT along with a parameter containing a
 sequence of values, lets say ('true', 'false', 'true'). I then want to
 iterate through the name elements, only outputing something when the
 corresponding value in the sequence is 'true'. In this case I would want
 to return

 <root>
    <user>
        <name>Robert</name>
        <name>Graham</name>
    </user>
 </root>


/root/user/name[position() = index-of(('true','false','true'), 'true')]


cheers
-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--