XML DOM parser question
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Neo_Gigs
Posted On:   Monday, April 15, 2002 12:49 AM

Hi there, I have been working with a sample applicatio that reads the display a XML file, but u hit these error: DomEcho.java:36: cannot resolve symbol symbol : method getExceptioin () location: class org.xml.sax.SAXException x = sxe.getExceptioin(); ^ DomEcho.java:39: cannot resolve symbol symbol : class ParseConfigurationException location: class DomEcho } catch (ParseConfigurationException pce) { ^ 2 errors Below is my source codes: // JAXP API import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.FactoryConfi   More>>

Hi there,


I have been working with a sample applicatio that reads the display a XML file, but u hit these error:

			
DomEcho.java:36: cannot resolve symbol
symbol : method getExceptioin ()
location: class org.xml.sax.SAXException
x = sxe.getExceptioin();
^
DomEcho.java:39: cannot resolve symbol
symbol : class ParseConfigurationException
location: class DomEcho
} catch (ParseConfigurationException pce) {
^
2 errors


Below is my source codes:

			
// JAXP API
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.FactoryConfigurationError;
import javax.xml.parsers.ParserConfigurationException;
// XML document parse exceptions
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
// reading XML file
import java.io.File;
import java.io.IOException;
// import W3C definition for DOM and DOM Exception
import org.w3c.dom.Document;
import org.w3c.dom.DOMException;
public class DomEcho {

static Document document;

public static void main(String argv[])
{
if (argv.length != 1) {
System.err.println("Usage: java DomEcho filename");
System.exit(1);
}

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

try {
DocumentBuilder builder = factory.newDocumentBuilder();
document = builder.parse(new File(argv[0]));

} catch (SAXException sxe) {
// Error generated during parsing
Exception x = sxe;
if (sxe.getException() != null)
x = sxe.getExceptioin();
x.printStackTrace();

} catch (ParseConfigurationException pce) {
// Parser with specified options can't be built
pce.printStackTrace();

} catch (IOException ioe) {
// I/O Error
ioe.printStackTrace();
}

} // main

} // DomEcho

where I had set my class path to c:xmltre2xml.jar...


Whats wrong?


TQ


Neo

   <<Less

Re: XML DOM parser question

Posted By:   Neo_Gigs  
Posted On:   Monday, April 15, 2002 12:56 AM

Sorry, it was my careless mistake on typo, please ignore this post.
About | Sitemap | Contact