/** * Create a new document * @return * @throws ParserConfigurationException */ public static Document createDocument() throws ConfigurationException { DocumentBuilderFactory factory = getDocumentBuilderFactory(); DocumentBuilder builder; try { builder = factory.newDocumentBuilder(); } catch (ParserConfigurationException e) { throw new ConfigurationException(e); } return builder.newDocument(); }
/** * Create a new document * * @return * @throws ParserConfigurationException */ public static Document createDocument() throws ConfigurationException { DocumentBuilderFactory factory = getDocumentBuilderFactory(); DocumentBuilder builder; try { builder = factory.newDocumentBuilder(); } catch (ParserConfigurationException e) { throw new ConfigurationException(e); } return builder.newDocument(); }
/** * Create a new document * @return * @throws ParserConfigurationException */ public static Document createDocument() throws ConfigurationException { DocumentBuilderFactory factory = getDocumentBuilderFactory(); DocumentBuilder builder; try { builder = factory.newDocumentBuilder(); } catch (ParserConfigurationException e) { throw new ConfigurationException(e); } return builder.newDocument(); }
/** * Create a document with the root element of the form <someElement xmlns="customNamespace" * * @param baseNamespace * @return * @throws ProcessingException */ public static Document createDocumentWithBaseNamespace(String baseNamespace, String localPart) throws ProcessingException { try { DocumentBuilderFactory factory = getDocumentBuilderFactory(); DocumentBuilder builder = factory.newDocumentBuilder(); return builder.getDOMImplementation().createDocument(baseNamespace, localPart, null); } catch (DOMException e) { throw logger.processingError(e); } catch (ParserConfigurationException e) { throw logger.processingError(e); } }
/** * Parse a document from a reader * * @param reader * @return * @throws ParsingException * @throws ParserConfigurationException * @throws IOException * @throws SAXException */ public static Document getDocument(Reader reader) throws ConfigurationException, ProcessingException, ParsingException { try { DocumentBuilderFactory factory = getDocumentBuilderFactory(); DocumentBuilder builder = factory.newDocumentBuilder(); return builder.parse(new InputSource(reader)); } catch (ParserConfigurationException e) { throw logger.configurationError(e); } catch (SAXException e) { throw logger.parserError(e); } catch (IOException e) { throw logger.processingError(e); } }
/** * Get Document from an inputstream * * @param is * @return * @throws ParserConfigurationException * @throws IOException * @throws SAXException */ public static Document getDocument(InputStream is) throws ConfigurationException, ProcessingException, ParsingException { DocumentBuilderFactory factory = getDocumentBuilderFactory(); try { DocumentBuilder builder = factory.newDocumentBuilder(); return builder.parse(is); } catch (ParserConfigurationException e) { throw logger.configurationError(e); } catch (SAXException e) { throw logger.parserError(e); } catch (IOException e) { throw logger.processingError(e); } }
/** * Get Document from a file * * @param file * @return * @throws ParserConfigurationException * @throws IOException * @throws SAXException */ public static Document getDocument(File file) throws ConfigurationException, ProcessingException, ParsingException { DocumentBuilderFactory factory = getDocumentBuilderFactory(); try { DocumentBuilder builder = factory.newDocumentBuilder(); return builder.parse(file); } catch (ParserConfigurationException e) { throw logger.configurationError(e); } catch (SAXException e) { throw logger.parserError(e); } catch (IOException e) { throw logger.processingError(e); } }
/** * Create a document with the root element of the form <someElement xmlns="customNamespace" * @param baseNamespace * @return * @throws ProcessingException */ public static Document createDocumentWithBaseNamespace(String baseNamespace, String localPart) throws ProcessingException { try { DocumentBuilderFactory factory = getDocumentBuilderFactory(); DocumentBuilder builder = factory.newDocumentBuilder(); return builder.getDOMImplementation().createDocument(baseNamespace, localPart, null); } catch (DOMException e) { throw new ProcessingException(e); } catch (ParserConfigurationException e) { throw new ProcessingException(e); } }
/** * Create a document with the root element of the form <someElement xmlns="customNamespace" * @param baseNamespace * @return * @throws ProcessingException */ public static Document createDocumentWithBaseNamespace(String baseNamespace, String localPart) throws ProcessingException { try { DocumentBuilderFactory factory = getDocumentBuilderFactory(); DocumentBuilder builder = factory.newDocumentBuilder(); return builder.getDOMImplementation().createDocument(baseNamespace, localPart, null); } catch (DOMException e) { throw new ProcessingException(e); } catch (ParserConfigurationException e) { throw new ProcessingException(e); } }
DocumentBuilderFactory factory = getDocumentBuilderFactory(); DocumentBuilder builder = factory.newDocumentBuilder(); return builder.parse(new InputSource(reader));
DocumentBuilderFactory factory = getDocumentBuilderFactory(); DocumentBuilder builder = factory.newDocumentBuilder(); return builder.parse(new InputSource(reader));
/** * Get Document from a file * @param file * @return * @throws ParserConfigurationException * @throws IOException * @throws SAXException */ public static Document getDocument(File file) throws ConfigurationException, ProcessingException, ParsingException { DocumentBuilderFactory factory = getDocumentBuilderFactory(); try { DocumentBuilder builder = factory.newDocumentBuilder(); return builder.parse(file); } catch (ParserConfigurationException e) { throw new ConfigurationException(e); } catch (SAXException e) { throw new ParsingException(e); } catch (IOException e) { throw new ProcessingException(e); } }
/** * Get Document from a file * @param file * @return * @throws ParserConfigurationException * @throws IOException * @throws SAXException */ public static Document getDocument(File file) throws ConfigurationException, ProcessingException, ParsingException { DocumentBuilderFactory factory = getDocumentBuilderFactory(); try { DocumentBuilder builder = factory.newDocumentBuilder(); return builder.parse(file); } catch (ParserConfigurationException e) { throw new ConfigurationException(e); } catch (SAXException e) { throw new ParsingException(e); } catch (IOException e) { throw new ProcessingException(e); } }
/** * Get Document from an inputstream * @param is * @return * @throws ParserConfigurationException * @throws IOException * @throws SAXException */ public static Document getDocument(InputStream is) throws ConfigurationException, ProcessingException, ParsingException { DocumentBuilderFactory factory = getDocumentBuilderFactory(); try { DocumentBuilder builder = factory.newDocumentBuilder(); return builder.parse(is); } catch (ParserConfigurationException e) { throw new ConfigurationException(e); } catch (SAXException e) { throw new ParsingException(e); } catch (IOException e) { throw new ProcessingException(e); } }
/** * Get Document from an inputstream * @param is * @return * @throws ParserConfigurationException * @throws IOException * @throws SAXException */ public static Document getDocument(InputStream is) throws ConfigurationException, ProcessingException, ParsingException { DocumentBuilderFactory factory = getDocumentBuilderFactory(); try { DocumentBuilder builder = factory.newDocumentBuilder(); return builder.parse(is); } catch (ParserConfigurationException e) { throw new ConfigurationException(e); } catch (SAXException e) { throw new ParsingException(e); } catch (IOException e) { throw new ProcessingException(e); } }