public void parse(String xmlOutput, SAXBuilder builder) { try { Document document = builder.build(new StringReader(xmlOutput)); parseDOMTree(document); } catch (Exception e) { bomb("Unable to parse svn info output: " + xmlOutput, e); } }
public List<Modification> parse(String svnLogOutput, String path, SAXBuilder builder) { try { Document document = builder.build(new StringReader(svnLogOutput)); return parseDOMTree(document, path); } catch (Exception e) { throw bomb("Unable to parse svn log output: " + svnLogOutput, e); } }
public HashMap<String, String> parseInfoToGetUUID(String output, String queryURL, SAXBuilder builder) { HashMap<String, String> uidToUrlMap = new HashMap<>(); try { Document document = builder.build(new StringReader(output)); Element root = document.getRootElement(); List<Element> entries = root.getChildren("entry"); for (Element entry : entries) { uidToUrlMap.put(queryURL, entry.getChild("repository").getChild("uuid").getValue()); } } catch (Exception e) { throw new RuntimeException(e); } return uidToUrlMap; }
private int getCurrentSchemaVersion(String content) { try { SAXBuilder builder = new SAXBuilder(); Document document = builder.build(new ByteArrayInputStream(content.getBytes())); Element root = document.getRootElement(); String currentVersion = root.getAttributeValue(schemaVersion) == null ? "0" : root.getAttributeValue(schemaVersion); return Integer.parseInt(currentVersion); } catch (Exception e) { throw bomb(e); } }
private Document parseXML(byte[] xml) throws Exception { SAXBuilder builder = new SAXBuilder(); InputStream stream = new ByteArrayInputStream(xml); return builder.build(stream); } }
public List<Modification> modifications() { try { SAXBuilder builder = new SAXBuilder(); Document document = builder.build(new StringReader(output)); return parseDOMTree(document); } catch (Exception e) { throw ExceptionUtils.bomb("Unable to parse hg log output: " + result.replaceSecretInfo(output), result.smudgedException(e)); } }
private Element elementFor(String content) throws JDOMException, IOException { SAXBuilder builder = new SAXBuilder(); return builder.build(new ByteArrayInputStream(content.getBytes())).getRootElement(); } }
return; Document document = new SAXBuilder().build(configFile); List<String> encryptedAttributes = Arrays.asList("encryptedPassword", "encryptedManagerPassword"); List<String> encryptedNodes = Arrays.asList("encryptedValue");
private static Document buildXmlDocument(InputStream inputStream, SAXBuilder builder) throws JDOMException, IOException { XsdErrorTranslator errorHandler = new XsdErrorTranslator(); builder.setErrorHandler(errorHandler); Document cruiseRoot = builder.build(inputStream); if (errorHandler.hasValidationError()) { throw new XsdValidationException(errorHandler.translate()); } return cruiseRoot; }
private Element getRenderedDocument(HtmlRenderer renderer) throws JDOMException, IOException { String renderedString = "<div>" + renderer.asString() + "</div>"; return new SAXBuilder().build(new StringReader(renderedString)).getRootElement(); }
public <T> T fromXmlPartial(InputStream inputStream, Class<T> o) throws Exception { Document document = new SAXBuilder().build(inputStream); Element element = document.getRootElement(); return classParser(element, o, configCache, new GoCipher(), registry, new ConfigReferenceElements()).parse(); }
public HierarchicalStreamReader createReader(URL in) { try { final SAXBuilder builder = createBuilder(); final Document document = builder.build(in); return new JDom2Reader(document, getNameCoder()); } catch (IOException e) { throw new StreamException(e); } catch (JDOMException e) { throw new StreamException(e); } }
public HierarchicalStreamReader createReader(File in) { try { final SAXBuilder builder = createBuilder(); final Document document = builder.build(in); return new JDom2Reader(document, getNameCoder()); } catch (IOException e) { throw new StreamException(e); } catch (JDOMException e) { throw new StreamException(e); } }
public HierarchicalStreamReader createReader(InputStream in) { try { final SAXBuilder builder = createBuilder(); final Document document = builder.build(in); return new JDom2Reader(document, getNameCoder()); } catch (IOException e) { throw new StreamException(e); } catch (JDOMException e) { throw new StreamException(e); } }
public HierarchicalStreamReader createReader(Reader reader) { try { final SAXBuilder builder = createBuilder(); final Document document = builder.build(reader); return new JDom2Reader(document, getNameCoder()); } catch (IOException e) { throw new StreamException(e); } catch (JDOMException e) { throw new StreamException(e); } }
r = builder.build( is );
public static Element getRootElemet(String xmlPath) { SAXBuilder builder = new SAXBuilder(); // builder.setValidation(false); Document doc; try { doc = builder.build(xmlPath); return doc.getRootElement(); } catch (Exception e) { e.printStackTrace(); return null; } }
public static Element getRootElemet(URL xmlPath) { SAXBuilder builder = new SAXBuilder(); // builder.setValidation(false); Document doc = null; try { doc = builder.build(xmlPath); } catch (Exception e) { e.printStackTrace(); } return doc.getRootElement(); }
/** * Parse metadataFile (currently for bounding box information). * * <p> * * @param shapefileFiles * @throws JDOMException * @throws IOException */ public ShpXmlFileReader(ShpFiles shapefileFiles) throws JDOMException, IOException { SAXBuilder builder = new SAXBuilder(false); InputStream inputStream = shapefileFiles.getInputStream(ShpFileType.SHP_XML, this); try { dom = builder.build(inputStream); } finally { inputStream.close(); } }
@Override public final Object getDocument(String url) throws FunctionCallException { SAXBuilder sb = new SAXBuilder(); try { return sb.build(url); } catch (JDOMException e) { throw new FunctionCallException("Failed to parse " + url, e); } catch (IOException e) { throw new FunctionCallException("Failed to access " + url, e); } }