Bug 11597

Summary: Namespace URI of element reported incorrectly
Product: Crimson Reporter: Michael Kay <Michael.H.Kay>
Component: otherAssignee: Edwin Goei <edwingo>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 1.1   
Target Milestone: ---   
Hardware: Other   
OS: other   

Description Michael Kay 2002-08-09 19:24:29 UTC
With the following source document:

<test2 xmlns="xyz:" xmlns:ZZZ="def:">
  <name>text
      <name ZZZ:dasAttribut="AttributWert" xmlns="abc:" 
            xmlns:ZZZ="def:">more text
      </name>
  </name>
  even more text
</test2>

Crimson reports the following startElement events to the ContentHandler: the 
parameters are (uri, localname, qname)

ContentEmitter#startElement xyz:,test2,test2 at line 1
ContentEmitter#startElement xyz:,name,name at line 2
ContentEmitter#startElement xyz:,name,name at line 4

The URI of the inner <name> element is being incorrectly reported.

This is the version included in JDK 1.4.

I suspect Crimson is using the original namespace adapter for SAX2 written by 
David Megginson, or something close to it, as this bug was present in this 
adapter. The bug used to be present in AElfred also (which used this adapter): 
cf. Saxon bug 6.2.2/011 (see http://saxon.sf.net/saxon6.5.2/changes.html): 

"There is an error in namespace handling in the AElfred parser. When a "real"  
attribute precedes a namespace declaration in an element start tag, and the 
Name of the element or of an attribute is the same as the QName of the parent 
element or one of its attributes, then the namespace URI assigned to the name 
may be based on the namespace declarations in force for the parent element 
rather than those for the child element."

Michael Kay