xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edwin Goei <Edwin.G...@eng.sun.com>
Subject Re: crimson
Date Tue, 13 Mar 2001 00:08:22 GMT
Christophe Jolif wrote:
> 
> I know that crimson is deprecated but as it is used in Sun JAXP
> distribution and as Xerces 2 is still not publically available (as far
> as I know), I hope that bug corrections or little enhancements are still
> accepted. If I well read Crimson pages, this list seems to be the right
> place to share my comments...

Yes, maintenance on crimson continues and bug fixes are very much
appreciated.  Thanks!

> 
> So, here is my problem, using the crimson.jar from the JAXP
> distribution, running the following test example (just done to
> demonstrate my problem):
> 
> import org.w3c.dom.*;
> 
> import org.apache.crimson.tree.*;
> 
> public class BugA
> {
>     // CJO 03/2001
>     public static void main(String[] arg) {
>         XmlDocument doc = new XmlDocument();
>         Element elt = doc.createElementNS(null, "foo");
>         doc.appendChild(elt);
>         elt.setAttributeNS(null, "bar", "bar_value");
>         elt.getAttributeNS(null, "bar");
>     }
> }

Thanks for the short test case.  I've checked in a fix for this.

BTW, the preferred way to create a DOM document is to use the JAXP 1.1
APIs and not internal parser APIs like XmlDocument().  Here is an
example:

DocumentBuilderFactory dbf = new DocumentBuilderFactory();
dbf.setNamespaceAware(true);  // needed b/c default value is false
DocumentBuilder db = dbf.newDocumentBuilder();
DOMImplementation di = db.getDOMImplementation();  // W3C DOM Impl
DocumentType dt = di.createDocumentType("pref:root", pubID, sysId);
Document doc = createDocument("http://someuri", "pref:root", dt);

Substitute appropriate values of the root node qname "pref:root" and
uri.  This will allow you to move your app easily to another parser such
as Xerces 2.

-Edwin

---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org


Mime
View raw message