public static Document createDocumentFromXml(String xmlContent) { Document doc = null; try { doc = builder2.build(new StringReader(xmlContent)); } catch (ValidityException e) { e.printStackTrace(); } catch (ParsingException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return doc; }
static Document createDictionary0(URL url) throws IOException { Document dictDoc = null; InputStream in = null; // this will fail if dictionary is badly formed try { in = url.openStream(); dictDoc = new CMLBuilder().build(in); } catch (NullPointerException e) { e.printStackTrace(); throw new RuntimeException("NULL " + e.getMessage() + S_SLASH + e.getCause() + " in " + url); } catch (ValidityException e) { throw new RuntimeException(S_EMPTY + e.getMessage() + S_SLASH + e.getCause() + " in " + url); } catch (ParsingException e) { System.err.println("ERR at line/col " + e.getLineNumber() + S_SLASH + e.getColumnNumber()); throw new RuntimeException(" in " + url, e); } finally { try { in.close(); } catch(IOException e) { e.printStackTrace(); } } return dictDoc; }
final ImmutableLexicalPositionType<Path> pos = ImmutableLexicalPosition.newPositionWithFile( e.getLineNumber(), e.getColumnNumber(), fs.getPath(e.getURI())); final StringBuilder sb = new StringBuilder(128); sb.append("Parsing failed.");
throw e; } catch (final ValidityException e) { JSCMain.LOG.error(e.getMessage()); throw e; } catch (final BadParseAttributeException e) {
public static Document createDocumentFromFile(String xmlFilePath) { Document doc = null; try { doc = builder1.build(new File(xmlFilePath)); } catch (ValidityException e) { e.printStackTrace(); } catch (ParsingException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return doc; }
public static Node createNode(String xmlDefintion) { Node node = null; try { node = builder2.build(new StringReader(xmlDefintion)).getRootElement().copy(); } catch (ValidityException e) { e.printStackTrace(); } catch (ParsingException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return node; }