Re: Namespaces in Xpath expressions

On Feb 10, 2006, at 03:23, Elliotte Harold wrote:
> This is a classic FAQ in XPath and XSLT. That's why it jumped out  
> at me. Arguably it's a design flaw in XPath.

I don't think it is, or at least the design trade-off makes sense to  
me. If the default namespace applied it would be hard to write paths  
that match elements in no namespace when the document in which the  
XPath is contained has one defined (which is usually the case). Also,  
it makes rules for element and attribute name parsing more regular in  
XPath.

> That said, what else would you suggest? If something with the power  
> of XPath is needed here (I don't know if it is--still haven't  
> finished digesting the draft) then I wouldn't want to reinvent the  
> wheel. If something much simpler (like a pure element name) could  
> be used then that might be OK; but I'm not sure anything simpler  
> would work.

Some people are asking that only ID matches be provided, which I  
think is too limited for practical purposes. XPath is simple and easy  
to implement, as well as generic to XML, I don't know of any other  
choice. REX isn't meant to work only for HTML.

-- 
Robin Berjon
    Senior Research Scientist
    Expway, http://expway.com/

Received on Friday, 10 February 2006 09:09:42 UTC