You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Ted Roeloffzen <te...@gmail.com> on 2006/12/06 09:52:31 UTC
Order By in XPath
Hi all,
Is there a standard way to order the results of an XPath query.
In SQL you would use order by, but does XPath have an equivelant?
Ted
Re: Order By in XPath
Posted by Ted Roeloffzen <te...@gmail.com>.
That worked.
Thank you very much.
Ted
2006/12/6, Marcel Reutegger <ma...@gmx.net>:
>
> Ted Roeloffzen wrote:
> > Is there a standard way to order the results of an XPath query.
> > In SQL you would use order by, but does XPath have an equivelant?
>
> no, strict XPath doesn't. but JSR 170 specifies an extension to standard
> XPath
> which is borrowed from XQuery.
>
> See spec section 6.6.5.5
>
> Example:
>
> //element(*, car)[@colour='green'] order by @price ascending
>
>
> regards
> marcel
>
Re: Order By in XPath
Posted by Marcel Reutegger <ma...@gmx.net>.
Ted Roeloffzen wrote:
> Is there a standard way to order the results of an XPath query.
> In SQL you would use order by, but does XPath have an equivelant?
no, strict XPath doesn't. but JSR 170 specifies an extension to standard XPath
which is borrowed from XQuery.
See spec section 6.6.5.5
Example:
//element(*, car)[@colour='green'] order by @price ascending
regards
marcel