[jdom-interest] Problems converting DOM 2 JDOM

buccaneer12 at gmx.de buccaneer12 at gmx.de
Thu Apr 12 04:02:42 PDT 2001


Hi, 

I am Trying to convert a apache xerces DOM to JDOM:

org.w3c.dom.Document dcmntDOM = new
org.apache.xerces.dom.DocumentImpl(false);
Element elmnt = dcmntDOM.createElement("aaaaaaaa");
elmnt.setAttribute("bbbbbbb", "ccccccc");
dcmntDOM.appendChild(elmnt);

DOMBuilder dmbldrDOMToJDOM = new
DOMBuilder(false);//strJDOMDOMBuilderAdapterClass);

org.jdom.Document dc = dmbldrDOMToJDOM.build(dcmntDOM);

When I run this:
org.jdom.IllegalNameException: The name "null" is not legal for JDOM/XML
elements: XML names cannot be null or empty.

	at org.jdom.Element.<init>(Element.java:137)

	at org.jdom.Element.<init>(Element.java:160)

	at org.jdom.input.DOMBuilder.buildTree(DOMBuilder.java:409)

	at org.jdom.input.DOMBuilder.buildTree(DOMBuilder.java:398)

	at org.jdom.input.DOMBuilder.build(DOMBuilder.java:359)

	at de.virtual_ivy_league.virtHo.XML.Test.JDOMTest.main(JDOMTest.java:45)


So what is the problem?

I am Using Xerces 1.3.1, Jdom 0.6, J2SDK13

Thankx

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net




More information about the jdom-interest mailing list