commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 32360] New: - Default Namespace not handled correctly
Date Tue, 23 Nov 2004 15:03:27 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=32360>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32360

           Summary: Default Namespace not handled correctly
           Product: Commons
           Version: 1.2 Final
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: JXPath
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: runger@cim.mcgill.ca


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.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message