public static OMFactory getOMFactory() { return new OMDOMFactory(); }
/** * Serialize the given node to a String. * * @param node Node to be serialized. * @return The serialized node as a java.lang.String instance. */ public static String nodeToString(Node node) { if (importerDoc == null) { OMDOMFactory fac = new OMDOMFactory(); importerDoc = (Document) fac.createOMDocument(); } // Import the node as an AXIOM-DOOM node and use toSting() Node axiomNode = importerDoc.importNode(node, true); return axiomNode.toString(); }
/** * Returns a new document impl. * * @see javax.xml.parsers.DocumentBuilder#newDocument() */ public Document newDocument() { OMDOMFactory factory = new OMDOMFactory(); DocumentImpl documentImpl = new DocumentImpl(factory); documentImpl.setComplete(true); return documentImpl; }
/** @see javax.xml.parsers.DocumentBuilder#parse(java.io.File) */ public Document parse(File file) throws SAXException, IOException { try { OMDOMFactory factory = new OMDOMFactory(); XMLStreamReader reader = StAXUtils .createXMLStreamReader(new FileInputStream(file)); StAXOMBuilder builder = new StAXOMBuilder(factory, reader); return (DocumentImpl) builder.getDocument(); } catch (XMLStreamException e) { throw new SAXException(e); } }
/** @see javax.xml.parsers.DocumentBuilder#parse(java.io.InputStream) */ public Document parse(InputStream is) throws SAXException, IOException { try { OMDOMFactory factory = new OMDOMFactory(); XMLStreamReader reader = StAXUtils .createXMLStreamReader(is); StAXOMBuilder builder = new StAXOMBuilder(factory, reader); return (DocumentImpl) builder.getDocument(); } catch (XMLStreamException e) { throw new SAXException(e); } }
public void applyPolicy(AxisDescription axisDescription, Element policy) { try { OMElement policyElement = (OMElement) new OMDOMFactory().getDocument().importNode(policy, true); axisDescription.applyPolicy(PolicyEngine.getPolicy(policyElement)); } catch (Exception e) { // TODO Handle exception properly throw new AssertionError(e); } }
public Document parse(InputSource inputSource) throws SAXException, IOException { try { OMDOMFactory factory = new OMDOMFactory(); // Not really sure whether this will work :-? XMLStreamReader reader = StAXUtils .createXMLStreamReader(inputSource.getCharacterStream()); StAXOMBuilder builder = new StAXOMBuilder(factory, reader); DocumentImpl doc = (DocumentImpl) builder.getDocument(); ((ElementImpl) doc.getDocumentElement()).build(); return (DocumentImpl) builder.getDocument(); } catch (XMLStreamException e) { throw new SAXException(e); } }
OMElement receivedKeyInfoElem = (OMElement) new OMDOMFactory().getDocument().importNode(keyInfo, true);
OMElement receivedKeyInfoElem = (OMElement) new OMDOMFactory().getDocument().importNode(keyInfo, true);
rsaKey = val.getRSAKeyValue(); elem = rsaKey.getDOM(); omElem = (OMElement) new OMDOMFactory().getDocument().importNode(elem, true); modElem = (Element) omElem.getFirstChildWithName(Modulus.DEFAULT_ELEMENT_NAME); expElem = (Element) omElem.getFirstChildWithName(Exponent.DEFAULT_ELEMENT_NAME);
public Document createDocument(String namespaceURI, String qualifiedName, DocumentType doctype) throws DOMException { // TODO Handle docType stuff OMDOMFactory fac = new OMDOMFactory(); DocumentImpl doc = new DocumentImpl(fac); fac.setDocument(doc); new ElementImpl(doc, DOMUtil.getLocalName(qualifiedName), new NamespaceImpl(namespaceURI, DOMUtil .getPrefix(qualifiedName)), fac); return doc; }