Subject: Re: [xsl] Filtering, xslt 2.0 From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Mon, 31 Oct 2022 16:56:28 -0000 |
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:I see two options, pass in a single string like you do and tokenize e.g.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?
tokenize($membership, ',') = membershipWhat's the command line then? membership=a,b,c
with Saxon HE 11 and the command line, both with Bash and with Powershell, and the parameter can be processed as said with e.g.
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)
Where's this please Martin? In the match?or use an XPath expression for the parameter with e.g. (Saxon 9/10/11, I think)
?membership='a','b','c'
On the command line, you prefix the parameter name with a question mark to indicate you provide an XPath expression on the right side of the "=".
then you have $membership in XSLT/XPath 2 and later as a sequence of three strings (e.g. a, b, c)
(might need other/additional quotes, depending on the command shell), thenshell is bash
$membership = membership
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Filtering, xslt 2.0, Dave Pawson dave.paw | Thread | Re: [xsl] Filtering, xslt 2.0, Dave Pawson dave.paw |
Re: [xsl] Filtering, xslt 2.0, Graydon graydon@xxxx | Date | Re: [xsl] Filtering, xslt 2.0, Dave Pawson dave.paw |
Month |