/** {@inheritDoc} */ public Document newDocument() throws XMLParserException { DocumentBuilder builder = getBuilder(); Document document = builder.newDocument(); returnBuilder(builder); return document; }
/** {@inheritDoc} */ public Document newDocument() throws XMLParserException { DocumentBuilder builder = getBuilder(); Document document = builder.newDocument(); returnBuilder(builder); return document; }
/** {@inheritDoc} */ public Document parse(Reader input) throws XMLParserException { DocumentBuilder builder = getBuilder(); try { Document document = builder.parse(new InputSource(input)); return document; } catch (SAXException e) { throw new XMLParserException("Invalid XML", e); } catch (IOException e) { throw new XMLParserException("Unable to read XML from input stream", e); } finally { returnBuilder(builder); } }
/** {@inheritDoc} */ public Document parse(Reader input) throws XMLParserException { DocumentBuilder builder = getBuilder(); try { Document document = builder.parse(new InputSource(input)); return document; } catch (SAXException e) { throw new XMLParserException("Invalid XML", e); } catch (IOException e) { throw new XMLParserException("Unable to read XML from input stream", e); } finally { returnBuilder(builder); } }
/** {@inheritDoc} */ public Document parse(InputStream input) throws XMLParserException { DocumentBuilder builder = getBuilder(); try { Document document = builder.parse(input); return document; } catch (SAXException e) { throw new XMLParserException("Invalid XML", e); } catch (IOException e) { throw new XMLParserException("Unable to read XML from input stream", e); } finally { returnBuilder(builder); } }
/** {@inheritDoc} */ public Document parse(InputStream input) throws XMLParserException { DocumentBuilder builder = getBuilder(); try { Document document = builder.parse(input); return document; } catch (SAXException e) { throw new XMLParserException("Invalid XML", e); } catch (IOException e) { throw new XMLParserException("Unable to read XML from input stream", e); } finally { returnBuilder(builder); } }