Really impossible in XPath 1.0?

S

Soren Kuula

Hi,

In the XPath 2.0 requirements (http://www.w3.org/TR/xpath20req/), you
see claims like:

1. In XPath 1.0, the expression |5 > $ns| evaluates to true if |5| is
greater than the |number()| value of at least one node in the
|$ns| node set. There is no way to test whether |5| is greater
than the |number()| values of all nodes in |$ns|.

Is it really so ? What's wrong with 'not (5 < $ns)' ?

(ok I could try in some XPath evaluator, but I might do it wrong, it
might have bugs, and in any case I would not get to know the reason for
being right / wrong)

Soren
 
D

Dimitre Novatchev

Soren Kuula said:
Hi,

In the XPath 2.0 requirements (http://www.w3.org/TR/xpath20req/), you see
claims like:

1. In XPath 1.0, the expression |5 > $ns| evaluates to true if |5| is
greater than the |number()| value of at least one node in the
|$ns| node set. There is no way to test whether |5| is greater
than the |number()| values of all nodes in |$ns|.

Is it really so ? What's wrong with 'not (5 < $ns)' ?

Nothing. But it shoud be:

not (5 <= $ns)

Yes, this particular statement of the XPath 2.0 Requirements is not true.


Cheers,
Dimitre Novatchev
 
S

Soren Kuula

Dimitre said:
Nothing. But it shoud be:

not (5 <= $ns)
Oooops, yes.. <sick-excuses>You can't compare floating point values
accurately anyway :) said:
Yes, this particular statement of the XPath 2.0 Requirements is not true.
Many of the others aren't either, then ..?

Soren
 
S

Soren Kuula

In fact, I see something funny about all of them ....

1) We just got that falsified

2) That the number() values of all in $ns1 are graeater than all the
number() values in $ns2, means
not (exists(node n in $n2, so that forall node m in $n1:
number(n)>=number(m)))
not($ns2 >= $ns1)

3) not (5!=$ns)

4) same as 2

5) Huh? Any of the attributes with the same name, on the same element?
And how many would that be, of not 1?
Do they mean some namspace something?

Maybe I should stick with XPath 1.0 :)

Soren
 
S

Soren Kuula

| 5) Huh? Any of the attributes with the same name, on the same element?
And how many would that be, of not 1?

Zzzzzzzzero, of course, I forgot. But that still doesn't give us a need
for a mechanism for finding something in any attribute of the same name,
under the same element.

Soren
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top