This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 36294

Summary: XMLUtil.write fails for a document from Crimson w/ namespaces
Product: platform Reporter: Jesse Glick <jglick>
Component: -- Other --Assignee: Jesse Glick <jglick>
Status: VERIFIED FIXED    
Severity: blocker CC: pkuzel
Priority: P2    
Version: 3.x   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 36297    

Description Jesse Glick 2003-09-26 02:23:09 UTC
If you parse a namespaced document with Crimson
and write it out, it works. But if you use
createDocument and write it out, the namespace is
omitted.

org.apache.crimson.tree.ElementNode2.writeXml has:

        // ...
	out.write (tagStart, 0, 1);	// "<"
	out.write (qName);
        // ...

I.e. it does not even try; probably it only works
after a parse due to the 'xmlns' pseudoattr being
serialized back as is.

Xerces (XMLSerializer) works fine.

XMLUtil therefore needs to refuse to use Crimson's
serializer when any element in the document has a
namespace. It can use Xerces if available.
Comment 1 Jesse Glick 2003-09-26 21:21:54 UTC
committed   * Up-To-Date  1.7        
openide/src/org/openide/xml/XMLUtilImpl.java
committed   * Up-To-Date  1.52        openide/test/build.xml
committed   * Up-To-Date  1.6        
openide/test/unit/src/org/openide/xml/XMLUtilTest.java
Comment 2 Lukas Hasik 2004-02-25 15:50:31 UTC
verified, fixed by reporter