[Xpath-ng] My favorite XPath language

David Rosenborg darolst at pantor.com
Thu Nov 21 15:11:49 MST 2002


Uche wrote:

> >     $find-member := func ($struct, $name) { $struct/member [@name =
> > $name] }
> >     ...
> >     $find-member ($some-struct, 'foo')
>
> Interesting.  This would seem to require some multiple statement
> support, moving away from the simple expression roots of XPath.  I have
> no objections to this, prima facie, but I wanted to mention this fact.

That's dependig on what you mean by statements. It's enough to say that each
expression can be prepended by zero or more variable declarations.

> Going with my previous thought on work products, I could see 2 modules
> here: a context definition module and a function definition module.

Yup

> > XPath 1.0 expressions should work unmodifed when processed by an XPath
> > Ng
> > processor.
>
> I really like this design principle, but I wonder whather we'll be able
> to stick to it as we go on.

I think that if we must break compatibility it should at least be reflected
in the syntax so that incompatible XPath 1.0 expressions won't even parse.
It's pretty dangerous to do changes like, for example, letting "true () and
'0'"
return false, that is, just changing semantis should be avoided.

> > In my opinion it wouldn't be to bad to have the so called "Computed
> > Constructors"
> > from XQuery available in XPath Ng. Though this might be too great of
> > an overlap
> > with XSLT.
>
> Well, if XPath NG becomes self-sufficient, then I think we might as well
> support output facilities, and we could borrow with reason from XQuery.
> Again, this sounds like an "output" or "constructor" module.

I don't think it has to do so much with output. It's just about creating new
nodes. But I don't know what module that puts it in.

> > Instead of treating everyting as a sequnce as XPath 2.0 does, I think
> > XPath Ng
> > could have a separate list type and a set of functions and possibly
> > primitives
> > that operates on list instances.
>
> OK.  Could lists hold any other data types besides single nodes?

Any object, including node sets, functions and other lists.

> Thanks for your thoughts.  I've had a look at FXPath before, and I'll
> look again while gathering ideas.  One thing: I like your stylesheet on
> http://www.pantor.com/fxpath/.  It would be a nice stylesheet for XPath
> NG Web work products, subject to your agreement, general agreement, and
> whether we ever produce anything that merits a stylesheet  :-)

Sure, no problem, I'll make the stylesheet available if it's seen fit for Relax
Ng
work products. I'll also be happy to help adapting it to whatever (if ever)
schema we will use. As it stands now it's pretty limited to what I did to get
the FXPath document done.

Cheers,
David




More information about the Xpath-ng mailing list