From: "Christian Nentwich" <[EMAIL PROTECTED]> > > I suspect because of your NamespaceContext all the standard XPath functions > > are disappearing, since they are not found in your custom URI namespace. I > > think its probably an error for a NamespaceContext to bind an empty prefix > > to a URI. > > So in other words, jaxen cannot rebind the default namespace at all.. > how to match /foo/bar if the default namespace changes? Do I have to > force people to use /prefix:foo/prefix:bar? That wouldn't be good for > compatibility..
This is an XPath 1.0 thing - its nothing Jaxen specific. In XPath the expression /foo/bar means foo and bar are not in any namespace. Binding non-prefixes to some namespace is an error. e.g. check this bit of the XPath spec... http://www.w3.org/TR/xpath#node-tests A QName in the node test is expanded into an expanded-name using the namespace declarations from the expression context. This is the same way expansion is done for element type names in start and end-tags except that the default namespace declared with xmlns is not used: if the QName does not have a prefix, then the namespace URI is null (this is the same way attribute names are expanded). i.e. the same namespace rules are used for attributes; that no prefix means no namespace URI. So irrespective of how you may use default no-prefix namespaces in your document, in XPath expressions you have to use prefixes to denote namespaces. You could try hacking your own special FunctionContext that will map the standard XPath functions to be in whatever namespace you like and keep your special NamespaceContext. Though I think this could be a confusing hack to users since it breaks XPath 1.0. James _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com _______________________________________________________________ Hundreds of nodes, one monster rendering program. Now that’s a super model! Visit http://clustering.foundries.sf.net/ _______________________________________________ Jaxen-interest mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jaxen-interest