/** * Transform a SAXStore into a TinyTree document * * @param saxStore input SAXStore * @return DocumentInfo */ public static DocumentInfo saxStoreToTinyTree(Configuration configuration, SAXStore saxStore) { final TinyBuilder treeBuilder = new TinyBuilder(); try { final TransformerXMLReceiver identity = getIdentityTransformerHandler(configuration); identity.setResult(treeBuilder); saxStore.replay(identity); } catch (SAXException e) { throw new OXFException(e); } return (DocumentInfo) treeBuilder.getCurrentRoot(); }
/** * Transform a SAXStore into a dom4j document * * @param saxStore input SAXStore * @return dom4j document */ public static Document saxStoreToDom4jDocument(SAXStore saxStore) { final TransformerXMLReceiver identity = getIdentityTransformerHandler(); final LocationDocumentResult documentResult = new LocationDocumentResult(); identity.setResult(documentResult); try { saxStore.replay(identity); } catch (SAXException e) { throw new OXFException(e); } return documentResult.getDocument(); }