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

Re: Filtering, xslt 2.0

Subject: Re: Filtering, xslt 2.0
From: "Dave Pawson dave.pawson@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 31 Oct 2022 16:35:02 -0000
Re:  Filtering
<grin/> Not yet (will I ever be?) familiar with xslt 3.0

On Mon, 31 Oct 2022 at 16:22, Martin Honnen martin.honnen@xxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
>
> Am 10/31/2022 um 5:16 PM schrieb Dave Pawson dave.pawson@xxxxxxxxx:
> > Input xml contains
> > <data>
> > ...
> >     <membership>....</membership>
> > </data>
> > where membership can be one of a b c d
> >
> > cmd line param
> > membership=a
> > could be membership=a,b,c
> >
> > How to 'choose' only those matching the param values?
> > <xsl:template match="data">
> > <xsl:if test="$membership =./membership">
> >      <xsl:message>
> >     <xsl:value-of select='membership_type'/>
> >   </xsl:message>
> >      <xsl:apply-templates/>
> >    </xsl:if>
> > ..
> >
> >
> > How to pass a list, and then check for membership
> > of that list, one or more times?
>
> I see two options, pass in a single string like you do and tokenize e.g.
>
>    tokenize($membership, ',') = membership

What's the command line then?
membership=a,b,c
or "a b c"

Saxon doesn't like that.
saxon .....  membership="R.A.O.B. Associate"


<xsl:if test="tokenize($membership',')  =./membership">

Using Paid for saxon 9pe to produce op.xml
Unrecognized option: Associate
So space separated 'list' is wrong (somehow)


>
> or use an XPath expression for the parameter with e.g. (Saxon 9/10/11, I
> think)
>
>    ?membership='a','b','c'

Where's this please Martin? In the match?


>
> (might need other/additional quotes, depending on the command shell), then

shell is bash


>
>    $membership = membership
(Guess this is XSLT voodoo?)
    why oh why did the WG go ...


regards




-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.

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.