File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes importing javax.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "importing javax.xml" Watch "importing javax.xml" New topic

importing javax.xml

Andrew Shafer
Ranch Hand

Joined: Jan 19, 2001
Posts: 338

I'm kinda new to xml programming with Java, so bear with me.
If I import javax.xml.parsers.*, everything loads fine, but if I try to import javax.xml.transform.* it can't be found.
Any ideas? Is there something I need to include in my classpath?

Ajith Kallambella

Joined: Mar 17, 2000
Posts: 5782
Yup. The javax should be a part of your CLASSPATH. Also the .jar files.
If nothing works, try importing only the classes that you need in your program and see if that works.
Eg -
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.Transformer;
Ajith Kallambella M.
Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.

Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Andrew Shafer
Ranch Hand

Joined: Jan 19, 2001
Posts: 338

thanks Ajith,
What has me confused is it will load the javax.xml.parsers but not the javax.xml.transform. . .any recommendations?

Joined: Apr 08, 2001
Posts: 12
Are you sure you are using JAXP1.1. Because JAXP1.0 does not have any transform packages, while it has javax.xml.parsers. See if org.xml.sax.ContentHandler can be included, if you have problems in that as well, then you are surely using JAXP1.0.
I agree. Here's the link:
subject: importing javax.xml
It's not a secret anymore!