/** * Parse an InputStream of XML into Document. */ public final static Document parse(InputStream in) throws ParserConfigurationException, IOException, SAXException { return parse(new InputSource(in)); }
/** * Parse an InputStream of XML into Document. */ public final static Document parse(InputStream in) throws ParserConfigurationException, IOException, SAXException { return parse(new InputSource(in)); }
/** * Parse a Reader of XML into Document. */ public final static Document parse(Reader in) throws ParserConfigurationException, IOException, SAXException { return parse(new InputSource(in)); }
/** * Parse a Reader of XML into Document. */ public final static Document parse(Reader in) throws ParserConfigurationException, IOException, SAXException { return parse(new InputSource(in)); }
/** * Parse the contents of a URL's XML into Document. */ public final static Document parse(URL url) throws ParserConfigurationException, IOException, SAXException { return parse(new InputSource(url.toString())); }
/** * Parse the contents of a URL's XML into Document. */ public final static Document parse(URL url) throws ParserConfigurationException, IOException, SAXException { return parse(new InputSource(url.toString())); }
/** * Parse a String containing XML data into a Document. * Note that String contains XML itself and is not URI. */ public final static Document parse(String xml) throws ParserConfigurationException, IOException, SAXException { return parse(new InputSource(new StringReader(xml))); }
/** * Parse a String containing XML data into a Document. * Note that String contains XML itself and is not URI. */ public final static Document parse(String xml) throws ParserConfigurationException, IOException, SAXException { return parse(new InputSource(new StringReader(xml))); }
/** * Parse a File of XML into Document. */ public final static Document parse(File file) throws ParserConfigurationException, IOException, SAXException { return parse(new InputSource(new FileInputStream(file))); }
/** * Parse a File of XML into Document. */ public final static Document parse(File file) throws ParserConfigurationException, IOException, SAXException { return parse(new InputSource(new FileInputStream(file))); }
/** * Load properties from XML input. */ public void load(InputStream in) throws ParserConfigurationException, IOException, SAXException { loadFromDocument(XMLUtils.parse(in)); }
/** * Load properties from XML input. */ public void load(Reader in) throws ParserConfigurationException, IOException, SAXException { loadFromDocument(XMLUtils.parse(in)); }
/** * Parse XML document from String in byte array. */ private Document readXML(String data) { try { return XMLUtils.parse(data); } catch(Exception e) { throw new PropertyImplementationException("Cannot parse XML data", e); } }
value = XMLUtils.parse(data);
return XMLUtils.parse(text); } catch (Exception ex) { return null; // if XML cannot be parsed, ignore it.
protected List buildChildAdapters() { Node node; if (getParseStringAsXML()) { log.debug("parsing string as xml: " + getStringValue()); // Parse the String to a DOM, then proxy that as our child try { node = XMLUtils.parse(getStringValue()); } catch (ParserConfigurationException e) { throw new WebWorkException(e); } catch (IOException e) { throw new WebWorkException(e); } catch (SAXException e) { throw new WebWorkException(e); } node = getAdapterFactory().proxyNode(this, node); } else { log.debug("using string as is: " + getStringValue()); // Create a Text node as our child node = new SimpleTextNode(getAdapterFactory(), this, "text", getStringValue()); } List children = new ArrayList(); children.add(node); return children; }