[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Re: [xml-dev] union operator and predicates in XSLT patterns
- From: "G. Ken Holman" <gkholman@CraneSoftwrights.com>
- To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
- Date: Mon, 24 Jan 2011 12:13:37 -0500
At 2011-01-24 17:06 +0000, HILLMAN, Tomos wrote:
>Hi; just a quick query for my own understanding. Apologies if I've
>gotten the wrong list.
XSLT and XPath questions would be better posted to the following list:
http://www.mulberrytech.com/xsl/xsl-list
There are a number of subscribers who would enthusiastically respond
to such questions.
>I wanted to use both a union and operator in an XLST template, i.e.
>match="(div1|div2)[not(@role)]" (simplified).
Nope ... not allowed ... the parentheses grouping the union is not allowed.
You have to write the above as:
match="div1[not(@role)] | div2[not(@role)]"
>This is, I think, equivalent in XPath 2.0 as
>"/*//(div1|div2)[not(@role)]", which I would expect to follow the
>rule for patterns in XSLT (the node $N matches pattern PAT if $N is
>a member of expression "root($N)//(PAT)". However, this shows as invalid.
>
>Can someone explain this to me? :)
Simple restriction of the syntax. The parentheses are a sequence
operator, in effect creating the sequence of the union of div1 and
div2. Sequences are not allowed in match patterns.
Sequences are, of course, available to use in select= expressions.
I hope this helps.
. . . . . . . . . Ken
--
Contact us for world-wide XML consulting & instructor-led training
Crane Softwrights Ltd. http://www.CraneSoftwrights.com/x/
G. Ken Holman mailto:gkholman@CraneSoftwrights.com
Legal business disclaimers: http://www.CraneSoftwrights.com/legal
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]