United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6675332 sjsxp issue 49: Repairing XMLStreamWriter tries to use default namespace for attributes
6675332 : sjsxp issue 49: Repairing XMLStreamWriter tries to use default namespace for attributes

Details
Type:
Bug
Submit Date:
2008-03-14
Status:
Closed
Updated Date:
2012-04-25
Project Name:
JDK
Resolved Date:
2009-11-23
Component:
xml
OS:
generic
Sub-Component:
javax.xml.stream
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:
1.4.0

Related Reports
Backport:
Backport:
Backport:

Sub Tasks

Description
It looks like the repairing writer does not consider the fact that attributes
newer use default namespace (ie. if attribute has no prefix, it is not in any
namespace, independent of there is a default namespace binding or not), and
instead of assumes default namespace does apply to attributes.
A demonstration of this can be found from StaxTest (available from
http://stax.codehaus.org), test TestRepairingWriter#testAttributes.
(I can try to come up with a shorter snippet too, but this should be easy enough
to reproduce)

                                    

Comments
EVALUATION

ChangeSet=http://hg.openjdk.java.net/jdk6/jdk6/jaxp/rev/5c070921580c,ChangeRequest=6923146,ChangeRequest=6917454,ChangeRequest=6472982,ChangeRequest=6909759,ChangeRequest=6333993,ChangeRequest=6900779,ChangeRequest=6900773,ChangeRequest=6900249,ChangeRequest=6675332,ChangeRequest=6889654,ChangeRequest=6889649,ChangeRequest=6863312
                                     
2010-02-18
EVALUATION

The javadoc for the XMLStreamWriter in jdk6 states that:
writeAttribute(namespaceURI, localName, value) should output prefix:localName="value" [1] when namespaceURI is bound, where note [1] states "if namespaceURI == default Namespace URI, then no prefix is written"

This statement is a violation of Namespaces in XML 1.0. I will file a request to get this corrected in the javadoc and then fix this bug.
                                     
2008-03-14



Hardware and Software, Engineered to Work Together