Finding the correct library files for JAXP.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   David_Seruyange
Posted On:   Wednesday, April 18, 2001 11:15 AM

My classpath has: d:xml-xercesjava oolsxerces.jar; d:jaxpjaxp.jar; d:jaxpxalan.jar; d:jaxpcrimson.jar; If I am in my *.java source file and run the following: import org.w3c.dom.*; import org.xml.sax.*; import javax.xml.parsers.*; Everything is fine, but when I try and use: import com.sun.xml.tree.XmlDocument; Everything is wrong. I looked up com.sun.xml.tree.XmlDocument, supposedly it is a part of JAXP but I have already installed and updated my classpath with this library. Moreover, I can already reference a class in the JAXP    More>>


My classpath has:

d:xml-xercesjava oolsxerces.jar;

d:jaxpjaxp.jar;

d:jaxpxalan.jar;

d:jaxpcrimson.jar;





If I am in my *.java source file and run the following:



import org.w3c.dom.*;

import org.xml.sax.*;

import javax.xml.parsers.*;




Everything is fine, but when I try and use:


import com.sun.xml.tree.XmlDocument;



Everything is wrong. I looked up com.sun.xml.tree.XmlDocument, supposedly
it is a part of JAXP but I have already installed and updated my classpath
with this library. Moreover, I can already reference a class in the JAXP
library. Has anyone run into this, can anyone help me?




Thank you for reading this and even more if you can help!


-M    <<Less

Re: Finding the correct library files for JAXP.

Posted By:   Luigi_Viggiano  
Posted On:   Wednesday, April 18, 2001 12:57 PM

com.sun.xml.tree.* is contained in a jar called "parser.jar" that is not in your classpath.

I suggest you to not import com.sun.xml.* (it's wrong...) and to read more about jaxp to keep xml "implementation independency".


Is a good practice to import only org.w2c.dom.*, org.xml.sax.* and javax.xml.parsers.*, and no more third part xml packages.


xerces.jar is a parser (from Apache group),

crimson.jar is another parser (from Apache group, involved from Project X),

parser.jar is another one (Project X from Sun)...

May be wrong to keep different implementation of the same thing in the classpath...

About | Sitemap | Contact