From: Andres Corrada-E. <co...@ci...> - 2001-10-31 16:05:30
|
Hello, I'm trying to set-up Jython to use the XML functionality in jaxp.jar and parser.jar. The code fails with an error of the form: TypeError: parse(): 1st arg can't be coerced to java.io.File, org.xml.sax.InputSource, java.io.InputStream or String The code is as follows: # Create new SAXParser factory = SAXParserFactory.newInstance() saxParser = factory.newSAXParser() # Create new handler handler = BookLibrary() # The test file to parse file = java.io.File('./books.xml') saxParser.parse( file, handler) It seems that "parse" is being fed the class instance first, but I cannot figure out how to do the call properly. Similar code works within Java code, so I know classes are being recognized and have the required methods. Any clue what I'm doing wrong? Thank you. Andres Corrada-Emmanuel Senior Research Fellow Center for Intelligent Information Retrieval University of Massachusetts, Amherst |