Hi,

you will also need to include xml-apis.jar in your classpath. Those are the API definitions which are commopn to many projects (not only xerces).

-Arno

vindhyachal sharma wrote:
Hi,
I created a Serializertest.java file in which im importing import org.apache.xerces.parsers.DOMParser;when iam trying to complie this file it's giving error
C:\>javac -d . SerializerTest.java
SerializerTest.java:74: cannot access org.xml.sax.InputSource
file org\xml\sax\InputSource.class not found
parser.parse(xmlDocument);
^
SerializerTest.java:75: cannot resolve symbol
symbol : class Document
location: class javaxml2.SerializerTest
Document doc = parser.getDocument();
^
2 errors
i already included xercesImpl.jar file in my classpath iam not able to find out wht's wrong my code is like this:
package javaxml2;


import java.io.File;
import org.w3c.dom.Document;

import org.apache.xerces.parsers.DOMParser;
public class SerializerTest {

public void test(String xmlDocument, String outputFilename)
throws Exception {

File outputFile = new File(outputFilename);
DOMParser parser = new DOMParser();
parser.parse(xmlDocument);
Document doc = parser.getDocument();


DOMSerializer serializer = new DOMSerializer(); serializer.serialize(doc, new File(outputFilename)); } public static void main(String[] args) { if (args.length != 2) { System.out.println( "Usage: java javaxml2.SerializerTest " + "[XML document to read] " + "[filename to write out to]"); System.exit(0); }

try {
SerializerTest tester = new SerializerTest();
tester.test(args[0], args[1]);
} catch (Exception e) {
e.printStackTrace();
}
}
}
can u plz tell me wht's wrong in this code.
V.sharma





Vindhyachal Sharma

Application Engineer
RamInformatics Ltd
SriNagar Colony
Punjagutta
Hyderabad-500082
Ph:040-3741894/95 Ext:231



---------------------------------
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to