W3C home > Mailing lists > Public > www-xpath-comments@w3.org > October to December 2002

semantic meaning of predicates

From: Tianzhi Yang <tyang@firstrain.com>
Date: Mon, 4 Nov 2002 12:35:15 -0500 (EST)
Message-ID: <C1C4A3C0FEE62A45A35BE7890264FF27A66494@monsoon.us.ny.firstrain.com>
To: <www-xpath-comments@w3.org>




Hi, I got one question regarding the semantic meaning of predicates.
For example, in message:
<a>
	<b>
		<id>1</id>
		<id>2</id>
	</b>
	<b>
		<id>3</id>
		<id>4</id>
	</b>
</a>

1. Is there a difference between (a)./a[b/id='1' and b/id='2'] and (b)/a[b[id='1' and id='2']

1. Is there a difference between (c)/a[b/id='1' and b/id='3'] and(d) /a[b[id='1' and id='3']

I think that the difference in both cases are: the earlier xpath ((a) and (c))tries to select an "a" who has a child "b" satisfy one condition and another "b" satisfy the other, no matter these two "b"s are the same.
But the later ((b) and (d)) xpath tries to select an "a" who has a single child "b" that satisfy two conditions simultaneously.

So my conclusion is that all XPATHs are satisfied by the given message except for (d).
Is it correct? If not, is there a way to expression the condition previously given?

Thanks

Tianzhi
Received on Monday, 4 November 2002 13:27:52 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:05:55 GMT