In your first expression you were comparing two sequences: foo/bar/@att is a
sequence of attributes and “= ‘INPUT’” is effectively “ = (‘INPUT’)”, that is a
sequence of one item. Sequences are comparable such that if any item in the
left-hand sequence matches any item in the right-hand sequence then the
comparison resolves to true.
However, upper-case() is a function that takes one item, which is why it
failed—you were passing it a sequence (all the @entry attributes of all the
values of all the parameters in the current context).
Martin’s correction ensures that upper-case() gets a single parameter, not a
sequence.
Cheers,
Eliot
--
Eliot Kimber
http://contrext.com
On 3/28/17, 11:49 AM, "Kerry, Richard richard(_dot_)kerry(_at_)atos(_dot_)net"
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:
That's brilliant. Works fine. Thanks Martin.
I was tempted to say "that was easy" but it's only easy if you know the
answer...
Regards,
Richard.
Richard Kerry
BNCS Engineer, SI SOL Telco & Media Vertical Practice
T: +44 (0)20 3618 2669
M: +44 (0)7812 325518
Lync: +44 (0) 20 3618 0778
Room G300, Stadium House, Wood Lane, London, W12 7TA
richard(_dot_)kerry(_at_)atos(_dot_)net
-----Original Message-----
From: Martin Honnen martin(_dot_)honnen(_at_)gmx(_dot_)de
[mailto:xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com]
Sent: Tuesday, March 28, 2017 10:40 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Case-insensitive filter match for template wanted
On 28.03.2017 11:35, Kerry, Richard richard(_dot_)kerry(_at_)atos(_dot_)net
wrote:
> So I tried:
>
> <x:template match="section[ parameter/@name='Rule' ][ upper-case(
> parameter/value/@entry ) = 'INPUT' ]" mode="processes" >
>
>
>
> But that gives me (using Saxon HE9.7.0.5):
>
> “A sequence of more than one item is not allowed as the first argument
> of upper-case() ("INPUT", .....”
>
>
>
> Ok, I can see that is telling me I'm expecting too much from the
> system and it can't do the template match with the upper-case function
> applying to all the possible parameter/value/@entry values.
Use
<x:template match="section[ parameter/@name='Rule'
][parameter/value[upper-case(@entry) = 'INPUT' ]]" mode="processes" >
Atos, Atos Consulting, Worldline and Canopy The Open Cloud Company are
trading names used by the Atos group. The following trading entities are
registered in England and Wales: Atos IT Services UK Limited (registered number
01245534), Atos Consulting Limited (registered number 04312380), Atos Worldline
UK Limited (registered number 08514184) and Canopy The Open Cloud Company
Limited (registration number 08011902). The registered office for each is at 4
Triton Square, Regent’s Place, London, NW1 3HG.The VAT No. for each is:
GB232327983.
This e-mail and the documents attached are confidential and intended solely
for the addressee, and may contain confidential or privileged information. If
you receive this e-mail in error, you are not authorised to copy, disclose, use
or retain it. Please notify the sender immediately and delete this email from
your systems. As emails may be intercepted, amended or lost, they are not
secure. Atos therefore can accept no liability for any errors or their content.
Although Atos endeavours to maintain a virus-free network, we do not warrant
that this transmission is virus-free and can accept no liability for any
damages resulting from any virus transmitted. The risks are deemed to be
accepted by everyone who communicates with Atos by email.
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--