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 - XMLUtil.write fails for a document from Crimson w/ namespaces
Summary: XMLUtil.write fails for a document from Crimson w/ namespaces
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks: 36297
  Show dependency tree
 
Reported: 2003-09-26 02:23 UTC by Jesse Glick
Modified: 2008-12-22 18:48 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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