use of lux.xml.XmlReader in project ddf by codice.
the class DynamicSchemaResolver method createTinyBinary.
private byte[] createTinyBinary(String xml) throws XMLStreamException, SaxonApiException {
SaxonDocBuilder builder = new SaxonDocBuilder(processor);
XmlReader xmlReader = new XmlReader();
xmlReader.addHandler(builder);
xmlReader.setStripNamespaces(true);
xmlReader.read(IOUtils.toInputStream(xml));
XdmNode node = builder.getDocument();
TinyTree tinyTree = ((TinyDocumentImpl) node.getUnderlyingNode()).getTree();
TinyBinary tinyBinary = new TinyBinary(tinyTree, StandardCharsets.UTF_8);
return tinyBinary.getBytes();
}
Aggregations