xsl-list
[Top] [All Lists]

Re: [xsl] are multiple predicates same as boolean and

2008-11-21 09:42:33
Andrew Welch wrote:
apart from this use case you cited, are all other forms equivalent
(which do not involve positional predicates)?
No.

like,
X[(_at_)a='hi'][(_at_)b='hi..']
If X[(_at_)a='hi'] matches a node, then that node will become the context
node when evaluating [(_at_)b='hi..']

would be same as
X[(_at_)a='hi' and @b='hi..']
X is the context node here, so the predicate will be considering @b='hi..'

X[P][Q] is equivalent to X[P and Q] if and only if Q does not depend on
the context node at all.

Only / will change the context node, so I would've thought one
predicate after the other is pretty much equivalent apart from cases
that rely on size of the selection (which is the only thing that
changes after each predicate)

I was misunderstanding - sorry for the confusion.

Considering this XML:

<doc>
<X @a="1">
<Y @b="2"/>
</X>
</doc>

When <doc> is the context node, I was expecting that

X[Y[(_at_)b]] would do the same as X[Y][(_at_)b]

I (and Saxon) can see now that this is wrong.

Thanks Andrew,

        # r

-- 
Ronan Klyne
Business Collaborator Developer
Tel: +44 01189 028518
ronan(_dot_)klyne(_at_)groupbc(_dot_)com
www.groupbc.com

--~------------------------------------------------------------------
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>
--~--