Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Please help~

 
Serena Chen
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I compiled the program TACparsing fine but when I tried to run it. I got this exeption thrown:
"org.xml.sax.SAXException: System property org.xml.sax.driver not specified
at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory
.java:90)
at TACparsing.main(TACparsing.java:119)"

so it's complaining the line:
"XMLReader xr = XMLReaderFactory.createXMLReader();"
so, I looked up some XML&Java books and it says I need to check if my .jar has org.xml.sax blah blah but I don't know wher eI should look for those .jar files(which directory exactly?). Well, I am using SDK 1.4.1, someone told me it already came with all the files/classes I need for SAX/DOM and I don't need to download extra from vendor sites. is it true? then, how do I double check if I already have the parser?
does the error above telling me that I don't have the parser? and if so, what should I do?
All the java books don't explain well enough in setting up parser etc. please help, any input is appreciated~!
 
Fisher Daniel
Ranch Hand
Posts: 582
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you can use classes in javax.xml.parsers.
Example
SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser parser = factory.newSAXParser();
After that you can parse your xml data using parser object...
Correct me if i am wrong
thanks
daniel
SCJP
 
Roseanne Zhang
Ranch Hand
Posts: 1953
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic