Examples of DOMResult


Examples of javax.xml.transform.dom.DOMResult

            }
        }
       
        private Source mapToOld(Document doc, JAXBElement<?> mt) throws JAXBException, XMLStreamException {
            doc.removeChild(doc.getDocumentElement());
            DOMResult result = new DOMResult(doc);
            XMLStreamWriter r = StaxUtils.createXMLStreamWriter(result);
            context.createMarshaller().marshal(mt, r);
           
            XMLStreamReader domReader = StaxUtils.createXMLStreamReader(doc);
            Map<String, String> inMap = new HashMap<String, String>();
View Full Code Here

Examples of javax.xml.transform.dom.DOMResult

            DOMSource beforeSource = new DOMSource(in);
           
            Document out = DOMUtils.createDocument();

            Transformer trans = xsltTemplate.newTransformer();
            trans.transform(beforeSource, new DOMResult(out));

            return out;
        } catch (TransformerException e) {
            throw new Fault("XML_TRANSFORM", LOG, e, e.getMessage());
        }
View Full Code Here

Examples of javax.xml.transform.dom.DOMResult

        final List<DOMResult> results = new ArrayList<DOMResult>();

        context.generateSchema(new SchemaOutputResolver() {
            @Override
            public Result createOutput(String ns, String file) throws IOException {
                DOMResult result = new DOMResult();
               
                if (builtIns.containsKey(ns)) {
                    DOMResult dr = builtIns.get(ns);
                    result.setSystemId(dr.getSystemId());
                    results.add(dr);
                    return result;
                }
                result.setSystemId(file);
                results.add(result);
View Full Code Here

Examples of javax.xml.transform.dom.DOMResult

   
    public static XMLStreamWriter createXMLStreamWriter(Result r) {
        if (r instanceof DOMResult) {
            //use our own DOM writer to avoid issues with Sun's
            //version that doesn't support getNamespaceContext
            DOMResult dr = (DOMResult)r;
            Node nd = dr.getNode();
            if (nd instanceof Document) {
                return new W3CDOMStreamWriter((Document)nd);
            } else if (nd instanceof Element) {
                return new W3CDOMStreamWriter((Element)nd);
            } else if (nd instanceof DocumentFragment) {
View Full Code Here

Examples of javax.xml.transform.dom.DOMResult

                        node = ((DOMSource)source).getNode();
                        doTransform = false;
                    }
                   
                    if (doTransform) {
                        DOMResult domResult = new DOMResult();
                        domResult.setSystemId(source.getSystemId());
                        node = StaxUtils.read(source);
   
                        node = domResult.getNode();
                    }
                   
                    if (null != node) {
                        if (node instanceof Document) {
                            try {
View Full Code Here

Examples of javax.xml.transform.dom.DOMResult

        } finally {
            in.close();
        }
        Document actual = db.newDocument();
        // TODO: need to use getSAXSource (instead of toString) because of AXIOM-430
        TransformerFactory.newInstance().newTransformer().transform(soapEnvelope.getSAXSource(true), new DOMResult(actual));
        XMLAssert.assertXMLIdentical(XMLUnit.compareXML(expected, actual), true);
        soapEnvelope.close(false);
    }
View Full Code Here

Examples of javax.xml.transform.dom.DOMResult

              Document doc = docBuilder.newDocument();
              org.w3c.dom.DocumentFragment outNode =
                doc.createDocumentFragment();

              transformer.transform(new DOMSource(xmlDoc, inFileName),
                                    new DOMResult(outNode));

              // Now serialize output to disk with identity transformer
              Transformer serializer = stf.newTransformer();
              Properties serializationProps =
                stylesheet.getOutputProperties();
View Full Code Here

Examples of javax.xml.transform.dom.DOMResult

        domFactory.setNamespaceAware(true); // never forget this
        final DocumentBuilder builder = domFactory.newDocumentBuilder();
        final Document doc = builder.parse(configFile);

        final DOMSource source = new DOMSource(doc);
        final DOMResult result = new DOMResult();

        validator.validate(source, result);
        Document root = (Document) result.getNode();

        // TargetName
        Configuration returnConfiguration = new Configuration(pTargetAddress);
        Element targetListNode = (Element) root.getElementsByTagName(ELEMENT_TARGET_LIST).item(0);
        NodeList targetList = targetListNode.getElementsByTagName(ELEMENT_TARGET);
View Full Code Here

Examples of javax.xml.transform.dom.DOMResult

    public DOMBuilder() throws IOException {
        try {
            final TransformerHandler handler = FACTORY.newTransformerHandler();
            this.contentHandler = handler;
            this.lexicalHandler = handler;
            this.result = new DOMResult();
            handler.setResult(this.result);
        } catch (javax.xml.transform.TransformerException local) {
            throw (IOException) new IOException("Fatal-Error: Unable to get transformer handler").initCause(local);
        }
    }
View Full Code Here

Examples of javax.xml.transform.dom.DOMResult

            domFactory.setNamespaceAware(true); // never forget this
            final DocumentBuilder builder = domFactory.newDocumentBuilder();
            final Document doc = builder.parse(configFile);

            final DOMSource source = new DOMSource(doc);
            final DOMResult result = new DOMResult();

            validator.validate(source, result);

            return (Document) result.getNode();
        } catch (final SAXException exc) {
            throw new ConfigurationException(exc);
        } catch (final ParserConfigurationException exc) {
            throw new ConfigurationException(exc);
        } catch (final IOException exc) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.