public Node parse(final InputStream is, final String name) throws ParserException { file = name; try { stack = new ArrayList<XMLNode>(); final SAXParser sp = spf.newSAXParser(); sp.setProperty("http://xml.org/sax/properties/lexical-handler", this); sp.parse(new InputSource(is), this); return result; } catch (final IOException e) { throw new ParserException("Parser error (" + file + ":" + line + ")", e); } catch (final ParserConfigurationException e) { throw new ParserException("Parser error (" + file + ":" + line + ")", e); } catch (final SAXException e) { throw new ParserException("Parser error (" + file + ":" + line + ")", e); } }
final Throwable cause = e.getCause(); throw new TargetDescriptorException("XML parse error.", cause);