use of org.eclipse.wst.xml.xpath2.processor.DOMLoader in project webtools.sourceediting by eclipse.
the class CompleteNewApiTest method loadDOMDocument.
protected void loadDOMDocument(URL fileURL) throws IOException {
InputStream is = fileURL.openStream();
DOMLoader domloader = new XercesLoader();
domloader.set_validating(false);
domDoc = domloader.load(is);
domDoc.setDocumentURI(fileURL.toString());
}
use of org.eclipse.wst.xml.xpath2.processor.DOMLoader in project webtools.sourceediting by eclipse.
the class SeqCollectionFuncTest method loadCollection1Default.
private void loadCollection1Default() throws Exception {
DOMLoader domload = new XercesLoader();
URL fileURL = bundle.getEntry("/TestSources/bib.xml");
Document dom1 = domload.load(fileURL.openStream());
fileURL = bundle.getEntry("/TestSources/reviews.xml");
Document dom2 = domload.load(fileURL.openStream());
ArrayList arraylist = new ArrayList();
arraylist.add(dom1);
arraylist.add(dom2);
HashMap map = new HashMap();
map.put(FnCollection.DEFAULT_COLLECTION_URI, arraylist);
map.put(COLLECTION1, arraylist);
setCollections(map);
}
use of org.eclipse.wst.xml.xpath2.processor.DOMLoader in project webtools.sourceediting by eclipse.
the class SeqCollectionFuncTest method loadCollection2Default.
private void loadCollection2Default() throws Exception {
DOMLoader domload = new XercesLoader();
URL fileURL = bundle.getEntry("/TestSources/bib.xml");
Document dom1 = domload.load(fileURL.openStream());
fileURL = bundle.getEntry("/TestSources/reviews.xml");
Document dom2 = domload.load(fileURL.openStream());
fileURL = bundle.getEntry("/TestSources/books.xml");
Document dom3 = domload.load(fileURL.openStream());
ArrayList arraylist = new ArrayList();
arraylist.add(dom1);
arraylist.add(dom2);
arraylist.add(dom3);
HashMap map = new HashMap();
map.put(FnCollection.DEFAULT_COLLECTION_URI, arraylist);
map.put(COLLECTION2, arraylist);
setCollections(map);
}
use of org.eclipse.wst.xml.xpath2.processor.DOMLoader in project webtools.sourceediting by eclipse.
the class AbstractPsychoPathWTPTest method loadDOMDocument.
protected void loadDOMDocument(URL fileURL, Schema schema) throws IOException, DOMLoaderException {
InputStream is = testResolve(fileURL);
DOMLoader domloader = new XercesLoader(schema);
domloader.set_validating(false);
domDoc = domloader.load(is);
domDoc.setDocumentURI(fileURL.toString());
}
use of org.eclipse.wst.xml.xpath2.processor.DOMLoader in project webtools.sourceediting by eclipse.
the class AbstractPsychoPathWTPTest 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);
}
}
Aggregations