Inability of location steps to support multiple axes

I have developed an independent C++ implementation of the XML 1.0 and
Xpath 1.0 standards and during this time I noticed some deficiencies
with the current Xpath specifications.

Primarily there is a lack of ability to combine one or more axes in a
location step.  Though this is not a language limiting feature, it does
make statementes where bi-directional functionality is required very
cumbersome.

This deficiency deviates somewhat from the obvious goal of the location
path, which is too progressively filter a selection of nodes.  With each
"/" in the location step representing a new filter, it makes sense to
focus not on "axes" but on a "selection" of nodes.

For example, in the current Xpath expresssions the following is
cumbersome:

"parent::a/following-sibling::*//text() |
parent::a/preceding-sibling::*//text()"

An obvious solution to the problem which I would like to propose is to
allow Xpath filter expressions to occur as location steps.  This is easy
to implement and does not deviate from the purpose of the filter
expression which is to take a function or an expression which returns a
node-set and filter it by optional predicates, just like a location
step.

It should be noted that the grammar (in Xpath 1.0) atleast for the
filter expression is very poor, and fails to force the intended
behaviour of the filter expression.

So the above example would become:

"parent::a/(following-sibling::* | preceding-sibling::*)//text()"

Which in my opinion is logically much more concise...

Regards,

Emerson 
http://harvestman.net

Received on Saturday, 6 September 2003 09:12:11 UTC