use of org.brackit.xquery.node.parser.DocumentParser in project sirix by sirixdb.
the class Load method add.
private TemporalCollection<?> add(final org.brackit.xquery.xdm.Store store, final DBCollection coll, final String resName, final Sequence resources) throws DocumentException, IOException {
if (resources instanceof Atomic) {
final Atomic res = (Atomic) resources;
coll.add(resName, new DocumentParser(URIHandler.getInputStream(res.stringValue())));
return coll;
} else {
final ParserStream parsers = new ParserStream(resources);
try {
for (SubtreeParser parser = parsers.next(); parser != null; parser = parsers.next()) {
coll.add(resName, parser);
}
} finally {
parsers.close();
}
return coll;
}
}
use of org.brackit.xquery.node.parser.DocumentParser in project sirix by sirixdb.
the class IndexController method deserialize.
/**
* Deserialize from an {@link InputStream}.
*
* @param out the {@link InputStream} from which to deserialize the XML fragment
* @throws SirixException if an exception occurs during serialization
*/
public Node<?> deserialize(final InputStream in) throws SirixException {
try {
final DocumentParser parser = new DocumentParser(in);
final D2NodeBuilder builder = new D2NodeBuilder();
parser.parse(builder);
return builder.root();
} catch (final DocumentException e) {
throw new SirixException(e);
}
}
Aggregations