use of org.eclipse.wst.xml.xpath2.processor.DOMLoader in project webtools.sourceediting by eclipse.
the class AbstractPsychoPathWTPTest method load2DOMDocument.
protected void load2DOMDocument(URL fileURL, URL fileURL2) throws IOException, DOMLoaderException {
InputStream is = testResolve(fileURL);
InputStream is2 = testResolve(fileURL2);
DOMLoader domloader = new XercesLoader();
domloader.set_validating(false);
domDoc = domloader.load(is);
domDoc.setDocumentURI(fileURL.toString());
domDoc2 = domloader.load(is2);
domDoc2.setDocumentURI(fileURL2.toString());
is.close();
is2.close();
}
use of org.eclipse.wst.xml.xpath2.processor.DOMLoader in project webtools.sourceediting by eclipse.
the class AbstractPsychoPathWTPTest method formatResultString.
protected String formatResultString(String resultFile) throws Exception {
DOMLoader domloader = new XercesLoader(null);
domloader.set_validating(false);
InputStream is = bundle.getEntry(resultFile).openStream();
Document resultDoc = domloader.load(is);
DOMImplementationLS domLS = (DOMImplementationLS) resultDoc.getImplementation().getFeature("LS", "3.0");
LSSerializer serializer = domLS.createLSSerializer();
String actual = serializer.writeToString(resultDoc.getDocumentElement());
actual = actual.replace("<?xml version=\"1.0\" encoding=\"UTF-16\"?>", "");
return actual.trim();
}
use of org.eclipse.wst.xml.xpath2.processor.DOMLoader in project webtools.sourceediting by eclipse.
the class AbstractPsychoPathTest method resolveCharacterReferences.
protected String resolveCharacterReferences(String xpath) {
String docText = "<doc>" + xpath + "</doc>";
InputStream is;
try {
is = new ByteArrayInputStream(docText.getBytes("UTF-8"));
DOMLoader domloader = new XercesLoader();
domloader.set_validating(false);
Document temp = domloader.load(is);
return temp.getDocumentElement().getFirstChild().getTextContent();
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
} catch (DOMLoaderException e) {
throw new RuntimeException(e);
}
}
use of org.eclipse.wst.xml.xpath2.processor.DOMLoader in project webtools.sourceediting by eclipse.
the class AbstractPsychoPathTest method load2DOMDocument.
protected void load2DOMDocument(URL fileURL, URL fileURL2) throws IOException, DOMLoaderException {
InputStream is = testResolve(fileURL);
InputStream is2 = testResolve(fileURL2);
DOMLoader domloader = new XercesLoader();
domloader.set_validating(false);
domDoc = domloader.load(is);
domDoc.setDocumentURI(fileURL.toString());
domDoc2 = domloader.load(is2);
domDoc2.setDocumentURI(fileURL2.toString());
is.close();
is2.close();
}
Aggregations