This is common in Java when two classes have the same name (but different packages). You have to be explicit with your use in the code.
Where you want a Document instance variable for DOM4J, use org.dom4j.Document. And likewise for W3C, use org.w3c.Document in the code.


For Example:


void someMethod() { org.dom4j.Document dom4jDoc = DocumentHelper.createDocument(); org.w3c.Document w3cDoc = new org.w3c.Document(); //...

}

Hope that helps,
Dave

Stamatis Karbounarakis wrote:
Hello. I am currently refactoring an application built with org.w3c.dom
package using org.dom4j. I have tried the test code of the page 10 of the
cookbook to transform an dom4j document to a w3c document but I can get it
compiled! The example starts like:

import org.w3c.dom.Document

import org.dom4j.Document
.....

When I compile it I get  Ambiguous class: org.dom4j.Document and org.w3c.dom.Document
import org.dom4j.Document;
       ^

Have anyone seen this before? Is it a java problem?

Thanx

Stam



-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user



--

+------------------------------------------------------------+
| David Lucas                        mailto:[EMAIL PROTECTED]  |
| Lucas Software Engineering, Inc.   (740) 964-6248 Voice    |
| Unix,Java,C++,CORBA,XML,EJB        (614) 668-4020 Mobile   |
| Middleware,Frameworks              (888) 866-4728 Fax/Msg  |
+------------------------------------------------------------+
| GPS Location:  40.0150 deg Lat,  -82.6378 deg Long         |
| IMHC: "Jesus Christ is the way, the truth, and the life."  |
| IMHC: "I know where I am; I know where I'm going."    <><  |
+------------------------------------------------------------+

Notes: PGP Key Block=http://www.lse.com/~ddlucas/pgpblock.txt
IMHO="in my humble opinion" IMHC="in my humble conviction"
All trademarks above are those of their respective owners.




------------------------------------------------------- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php _______________________________________________ dom4j-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to