You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Richard Unger (JIRA)" <ji...@apache.org> on 2006/06/30 00:55:30 UTC

[jira] Commented: (JXPATH-61) [jxpath] Default Namespace not handled correctly

    [ http://issues.apache.org/jira/browse/JXPATH-61?page=comments#action_12418533 ] 

Richard Unger commented on JXPATH-61:
-------------------------------------

Hi!

This bug should really be closed, as elharo points out.

I originally reported and opened the bug, and spent a long time discussing it with other interested parties. As elharo pointed out, and as Patrick Melo's examples correctly show, for XPath 1.0, and XSL 1.0 the behaviour is correct as implemented in JXPath 1.2.

It is the XPath 1.0 standard itself that is (IMHO) deficient as far as this issue is concerned. Aparently, I was not the only one who thought so, as XPath 2.0 provides a way to register the default namespace as desired.

I say: close this bug, JXPath 1.2 is correct as it is.
In the future, when there is a JXpath 2.0, implementing XPath 2.0, then I will get the feature I wanted!

> [jxpath] Default Namespace not handled correctly
> ------------------------------------------------
>
>          Key: JXPATH-61
>          URL: http://issues.apache.org/jira/browse/JXPATH-61
>      Project: Commons JXPath
>         Type: Improvement

>     Versions: 1.2 Final
>  Environment: Operating System: All
> Platform: All
>     Reporter: Richard Unger
>     Priority: Minor

>
> JXPath 1.2 does not handle the default namespace correctly. There is no way to
> set the default namespace on a context, so xpath expressions with unprefixed
> node-selections do not match the default namespace.
> Eg:
> <?xml version="1.0" encoding="iso-8859-1"?>
> <test xmlns="http://test">
>   <child-element />
> </test>
> This is valid xml, with default namespace 'http://test'
> If the following xpath expression is used: '/test/childelement', it will not
> match the child-element element in this xml file.
> There appears to be no way to use the function JXPathContext.registerNamespace()
> to associate a default namespace with the context.
> The programmer is forced to introduce a namespace prefix for JXPath, the xpath
> expression 'foo:test/foo:child-element' will correctly match the element if 
> JXPathContext.registerNamespace("foo","http://test") is called first.
> This is, IMHO, a bug.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org