[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Idea to relax default ns handling in XPath 1.0

Subject: RE: Idea to relax default ns handling in XPath 1.0
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 31 Oct 2005 19:56:51 -0000
jxpath default namespace
I think conformance to the spec is more important than (superficial)
convenience to users. The XPath 1.0 spec says that "no prefix means no
namespace", and introducing a default namespace would make your
implementation non-conformant with XPath 1.0. That would confuse users more
than the current situation does, for example when they try to cut-and-paste
XPath expressions from one environment to another.

Adding a method call setDefaultElementNamespace("http://foo/") is not
significantly easier than adding the prefix "foo:" to each of the element
names and calling setNamespace("foo", "http://foo/"). The real usability
problem here is not the difficulty of adding the prefixes to the names, it's
the fact that people don't realize that they need to do it. You're not
stopping people from falling into this particular hole, all you're doing is
enabling them to climb out of it with fewer keystrokes, but by then the
damage has been done, they've already torn their hair out working out what's
gone wrong.

If you do have such a facility (and I would advise against), then make sure
that it only applies to unqualified element names and not to unqualified
attribute names. See the concept of "default namespace for elements" in
XPath 2.0 for guidance.

I have to say that the discussion on the bugzilla entry is extremely
confused, which doesn't bode well for coming up with a clean spec. 

Michael Kay
http://www.saxonica.com/



> -----Original Message-----
> From: Antonio Gallardo [mailto:agallardo@xxxxxxxxxxxxxxxxxxxxxxx] 
> Sent: 31 October 2005 18:25
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Idea to relax default ns handling in XPath 1.0
> 
> Hi:
> 
> In Apache commons-jxpath we discuss a simpler way to relax 
> the XPath 1.0
> handling for default namespaces:
> 
> http://issues.apache.org/bugzilla/show_bug.cgi?id=32360
> 
> Basically, the solution introduce a special handling flag for default
> namespaces:
> 
> http://issues.apache.org/bugzilla/show_bug.cgi?id=32360#c13
> 
> I will be glad if you can comment about the issue and how do 
> you see this.
> 
> Many thanks in advance.
> 
> Best Regards,
> 
> Antonio Gallardo.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.