On Sunday, January 6, 2002, at 12:13 PM, Timothy M. Dean wrote:
Note that at the current time, it does not appear that this mechanism works when you set a default namespace. However, it does work well when mapping specific prefixes to a namespace URI.

Is this a problem with the Xindice implementation, or the querying approach in general?


I started thinking about this problem recently, and here's where I see the flaw is. Say you have a document with a defaulted namespace nested deep within it, but no namespaced nodes in tree before that. Then, you create a namespace mapping for an XPath query that has a defaulted namespace that matches the deeply nested default namespace. Unless you use a // query, there will be absolutely no way for the XPath processor to traverse to the node with the defaulted namespace, because it can only see non-prefixed node references as being part of the mapped default namespace. It'd work fine in things like XSLT, where you're working off of a context node, but if your only option is to query against document roots, a default namespace will only buy you terseness and nothing else.

Therefore, I recommend not even having a default namespace as part of the Namespace mapping system. If you're going to use a namespace as part of your query, then you need to prefix it to avoid this potential problem.

Then again, I don't even believe that XML should have default namespaces, so what do I know.

--
Tom Bradford - http://www.tbradford.org
Developer - Apache Xindice (Native XML Database)
Creator - Project Labrador (XML Object Broker)

----------------------------------------------------------------------
Post a message:         mailto:[EMAIL PROTECTED]
Unsubscribe:            mailto:[EMAIL PROTECTED]
Contact administrator:  mailto:[EMAIL PROTECTED]
Read archived messages: http://archive.xmldb.org/
----------------------------------------------------------------------

Reply via email to