[Xpath-ng] Thoughts on work products

Uche Ogbuji uche.ogbuji at fourthought.com
Thu Nov 21 18:58:06 MST 2002


> 
> Howdy all--
> 
> Been watching the threads for a day or so and finally got some time to
> chip in.
> 
> First, over in jaxen-land, I personally have no desire to care at all
> about w3c-xpath-2.0.  The fact we support (at this point) 4 different
> InfoSet object models makes the imperfections and difficulties of 
> w3c-xpath-2.0 that much larger.
> 
> I definitely would like to track the xpath-ng thoughts and work them
> into jaxen if they appear to be more enlightened than the w3c's effort.

Well, the best thing about XPath NG is that there is no omerta and no entry 
fee.  You get to be as much of a source of enlightenment as the rest of us.  
So do chip in.

I also plan to really try aggressively to push implementation in 4Suite, and 
to try to set up a public demo server of some sort.  Nothing so far that has 
been proposed scares me from an implementor POV, which is good news, I think.


> Just off the top of my head, the one feature I'd like would be something
> similar to the STL algorithms idioms.  XPath 1.0 already gives us
> collections and iteration, so applying some algorithm to the set or each
> member would be good.

I think that if we support higher-order functions and other such functional 
goodness, as David Rosenborg supports, that we end up getting this for free.

STL jumps through a lot of hoops to essentially reinvent lambda calculus in 
C++.  I think XPath, dynmamic as it is, can give us the same goods more 
generically.


> The fact that XPath 1.0 many times will consider a NodeSet to be only
> the first node can hinder these types of operations.

List primitives and functions would address this, by allowing operations over 
whole lists.


> Stronger definition of ordering would be cool, also.  If there's any
> guarantee of order, let's not call it a 'Set'.

I noticed David Carlisle joined the list, so I'll shut up on this topic 
knowing it will be well minded  ;-)


> Also, let's not refer
> to 'the first node in the set'.   XPath 1.0 does include, implicitly,
> several ideas regarding ordering, and so Jaxen has used a Lists for the
> implementation.  Seems odd to return a List when the spec says NodeSet.

4XPath also uses Python lists for "node sets".  But this is really no more 
than an implementation detail that would come out in our favor if we do end up 
going with lists/sequences.  I will be curious to go over the 
efficiency/composability arguments that led to XPath 1.0's heavy use of sets.  
I think these ere supposed to bring about all sorts of efficiencies that no 
one ever ended up taking advantage of.


> I have no solution, but -something- to make working with namespaces 
> easier.

Agreed.  Mike Brown and I just yesterday ran into the old XSLT trip wire:

"The xsl:exclude-result-prefixes and exclude-result-prefixes attributes apply 
only to namespace nodes copied from the stylesheet using literal result 
elements. They do not affect namespace nodes copied from the source document 
using <xsl:copy> or <xsl:copy-of>; there is no way of suppressing these." -- 
Mike Kay

It just illustrates what a fragile conception namespace nodes and the whole 
XSLT/XPath machinery 1.0 is.

That having been said, is there any way to fix this and maintain backwards 
compatability?


> Once a week we get mail from someone who wonders why their
> XPath doesn't work, since they use the same ns-prefixes.  I see the
> value maintaining separate prefix->uri mappings for the XPath apart
> from the documents to which they are applied, but it causes headaches.
> 
> Bare-minimum, default NS for xpath exprs would rock.

Hmm.  Here be dragons, I think.  I think allowing default would make things 
even more sneaky in some cases.


-- 
Uche Ogbuji                                    Fourthought, Inc.
http://uche.ogbuji.net    http://4Suite.org    http://fourthought.com
Python&XML column: 2. Introducing PyXML - http://www.xml.com/pub/a/2002/09/25/p
y.html
The Past, Present and Future of Web Services 1 - http://www.webservices.org/ind
ex.php/article/articleview/663/1/24/
The Past, Present and Future of Web Services 2 - 'http://www.webservices.org/in
dex.php/article/articleview/679/1/24/
Serenity through markup - http://adtmag.com/article.asp?id=6807
Tip: Using generators for XML processing - http://www-106.ibm.com/developerwork
s/xml/library/x-tipgenr.html





More information about the Xpath-ng mailing list