commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Twiner (JIRA)" <>
Subject [jira] Commented: (JXPATH-61) [jxpath] Default Namespace not handled correctly
Date Mon, 21 Aug 2006 18:08:14 GMT
    [ ] 
Chris Twiner commented on JXPATH-61:

Is a further official release, incorporating revision 329964 of DOMNodePointer, planned? 
This revision includes a fix for empty xmlns="" attributes (equalStrings) which fixes the
following bug in 1.2:

Given the following document:

<?xml version="1.0" encoding="UTF-8"?>
   <soapenv:Envelope xmlns:soapenv=""
         <getMediaInfo xmlns="uriName">
            <sessionId xmlns="">sessionId-12345678</sessionId>
            <mediaId xmlns="">mediaId-fromClient-12345</mediaId>

the xpath 

/soapenv:Envelope/soapenv:Body/uri:getMediaInfo/sessionId = "sessionId-12345678"

will return false.

Which the specs seem to say should be true as xmlns="" is treated as no default namespace.


PS(We've been very happily using 1.2 for 10 months or so in our projects, this is the first
time I've seen any "problem" with it that I can't explain via the standards - brilliant effort).

> [jxpath] Default Namespace not handled correctly
> ------------------------------------------------
>                 Key: JXPATH-61
>                 URL:
>             Project: Commons JXPath
>          Issue Type: Improvement
>    Affects 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:
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message