You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Eugen Kimmerstorfer <eu...@jk.uni-linz.ac.at> on 2000/08/27 08:17:48 UTC

Predicates in XPath

Is there any documentation about what parts of
the W3C XPath-Reccommendation is currently implemented?

For example I've tried the following with the ApplyXPath
example of foo.xml:

   java ApplyXPath foo.xml //name[@first="David"]

This returned:

   <output>
   </output>

But this one ...

   java ApplyXPath foo.xml //name[@first='David']

... returned ...

   <output>
      <name .../>
      <name .../>
      <name .../>
   </output>

... which is correct. Another examples is

   java ApplyXPath foo.xml //name[@position() = 3]

Here the program stops and shows me the usage. But when
I write ...

   java ApplyXPath foo.xml //name[@position()=3]

... it works find (but maybe blanks are permitted in the
recommendation?). More serious is:

   java ApplyXPath foo.xml //name[@position()>3]

This should deliver all the name-elements beginning from
the third "position" in the XML-document (isn't it?). But
I get the following:

   XSL Error: pattern = '//name[position()'
   Expected ], but found: , stale tree node: .....
   ....
   selectNodeLide threw: ...
   Expected ], but found: perhaps your xpath ....

Am I doing wrong or are there things not implemented yet?

Anyway, I think you are doing a great job and it seems to
work pretty well already!

Thank you in advance,
Eugen

AW: Predicates in XPath

Posted by Eugen Kimmerstorfer <eu...@jk.uni-linz.ac.at>.
Thank you very much! Indeed, I was working within the command shell of
Win2K. Putting quotes around solved my problem.

Thank you again !!!

> -----Ursprüngliche Nachricht-----
> Von: Ed Staub [mailto:estaub@mediaone.net]
> Gesendet: Sonntag, 27. August 2000 17:35
> An: xalan-dev@xml.apache.org
> Betreff: RE: Predicates in XPath
>
>
> Eugen,
>
> It looks to me like your shell command line processor is changing
> your XPath
> expressions.
>
> Try using
> 	echo [your XPath expression]
> to see what it's doing.
>
> I don't know what shell or operating system you are using, so I can't give
> reliable tips.  Try putting quotes around your entire XPath expression.
>
> -Ed Staub
>
> -----Original Message-----
> From: Eugen Kimmerstorfer [mailto:eugen.kimmerstorfer@jk.uni-linz.ac.at]
> Sent: Sunday, August 27, 2000 2:18 AM
> To: xalan-dev@xml.apache.org
> Subject: Predicates in XPath
>
>
> Is there any documentation about what parts of
> the W3C XPath-Reccommendation is currently implemented?
>
> For example I've tried the following with the ApplyXPath
> example of foo.xml:
>
>    java ApplyXPath foo.xml //name[@first="David"]
>
> This returned:
>
>    <output>
>    </output>
>
> But this one ...
>
>    java ApplyXPath foo.xml //name[@first='David']
>
> ... returned ...
>
>    <output>
>       <name .../>
>       <name .../>
>       <name .../>
>    </output>
>
> ... which is correct. Another examples is
>
>    java ApplyXPath foo.xml //name[@position() = 3]
>
> Here the program stops and shows me the usage. But when
> I write ...
>
>    java ApplyXPath foo.xml //name[@position()=3]
>
> ... it works find (but maybe blanks are permitted in the
> recommendation?). More serious is:
>
>    java ApplyXPath foo.xml //name[@position()>3]
>
> This should deliver all the name-elements beginning from
> the third "position" in the XML-document (isn't it?). But
> I get the following:
>
>    XSL Error: pattern = '//name[position()'
>    Expected ], but found: , stale tree node: .....
>    ....
>    selectNodeLide threw: ...
>    Expected ], but found: perhaps your xpath ....
>
> Am I doing wrong or are there things not implemented yet?
>
> Anyway, I think you are doing a great job and it seems to
> work pretty well already!
>
> Thank you in advance,
> Eugen
>
>


RE: Predicates in XPath

Posted by Ed Staub <es...@mediaone.net>.
Eugen,

It looks to me like your shell command line processor is changing your XPath
expressions.

Try using
	echo [your XPath expression]
to see what it's doing.

I don't know what shell or operating system you are using, so I can't give
reliable tips.  Try putting quotes around your entire XPath expression.

-Ed Staub

-----Original Message-----
From: Eugen Kimmerstorfer [mailto:eugen.kimmerstorfer@jk.uni-linz.ac.at]
Sent: Sunday, August 27, 2000 2:18 AM
To: xalan-dev@xml.apache.org
Subject: Predicates in XPath


Is there any documentation about what parts of
the W3C XPath-Reccommendation is currently implemented?

For example I've tried the following with the ApplyXPath
example of foo.xml:

   java ApplyXPath foo.xml //name[@first="David"]

This returned:

   <output>
   </output>

But this one ...

   java ApplyXPath foo.xml //name[@first='David']

... returned ...

   <output>
      <name .../>
      <name .../>
      <name .../>
   </output>

... which is correct. Another examples is

   java ApplyXPath foo.xml //name[@position() = 3]

Here the program stops and shows me the usage. But when
I write ...

   java ApplyXPath foo.xml //name[@position()=3]

... it works find (but maybe blanks are permitted in the
recommendation?). More serious is:

   java ApplyXPath foo.xml //name[@position()>3]

This should deliver all the name-elements beginning from
the third "position" in the XML-document (isn't it?). But
I get the following:

   XSL Error: pattern = '//name[position()'
   Expected ], but found: , stale tree node: .....
   ....
   selectNodeLide threw: ...
   Expected ], but found: perhaps your xpath ....

Am I doing wrong or are there things not implemented yet?

Anyway, I think you are doing a great job and it seems to
work pretty well already!

Thank you in advance,
Eugen