Examples of toDOMSource()


Examples of org.apache.camel.converter.jaxp.XmlConverter.toDOMSource()

                String xslString = IOConverter.toString(new File("./src/main/resources/xpathreplacer.xsl"), exchange);
                xslString = xslString.replace("##match_token##", xpath);
                Source xslSource = xmlConverter.toStreamSource(new StringReader(xslString));
                TransformerFactory transformerFactory = xmlConverter.createTransformerFactory();
                Transformer transformer = transformerFactory.newTransformer(xslSource);
                source = xmlConverter.toDOMSource(document);
                result = new DOMResult();

                transformer.setParameter("cacheValue", cacheValueDocument);
                transformer.transform(source, result);
            } finally {
View Full Code Here

Examples of org.apache.camel.converter.jaxp.XmlConverter.toDOMSource()

        Map<String, String> namespaces = new HashMap<String, String>();
        visitNodesForNameSpace(element, namespaces);
        W3CDOMStreamWriter writer = new W3CDOMStreamWriter();
        writeElement(element, writer, namespaces);
        XmlConverter converter = new XmlConverter();
        return converter.toString(converter.toDOMSource(writer.getDocument()), null);
    }
   
    public static void copyHttpHeadersFromCxfToCamel(org.apache.cxf.message.Message cxfMessage,
                                                     org.apache.camel.Message camelMessage) {
        copyMessageHeader(cxfMessage, camelMessage, org.apache.cxf.message.Message.REQUEST_URI, Exchange.HTTP_URI);
View Full Code Here

Examples of org.apache.camel.converter.jaxp.XmlConverter.toDOMSource()

                String xslString = IOConverter.toString(new File("./src/main/resources/xpathreplacer.xsl"), exchange);
                xslString = xslString.replace("##match_token##", xpath);
                Source xslSource = xmlConverter.toStreamSource(new StringReader(xslString));
                TransformerFactory transformerFactory = xmlConverter.createTransformerFactory();
                Transformer transformer = transformerFactory.newTransformer(xslSource);
                source = xmlConverter.toDOMSource(document);
                result = new DOMResult();

                transformer.setParameter("cacheValue", cacheValueDocument);
                transformer.transform(source, result);
            } finally {
View Full Code Here

Examples of org.apache.camel.converter.jaxp.XmlConverter.toDOMSource()

        Map<String, String> namespaces = new HashMap<String, String>();
        visitNodesForNameSpace(element, namespaces);
        W3CDOMStreamWriter writer = new W3CDOMStreamWriter();
        writeElement(element, writer, namespaces);
        XmlConverter converter = new XmlConverter();
        return converter.toString(converter.toDOMSource(writer.getDocument()), null);
    }
   
    private static void writeElement(Element e,
                                    XMLStreamWriter writer,                                   
                                    Map<String, String> namespaces)
View Full Code Here

Examples of org.apache.camel.converter.jaxp.XmlConverter.toDOMSource()

                String xslString = IOConverter.toString(new File("./src/main/resources/xpathreplacer.xsl"), exchange);
                xslString = xslString.replace("##match_token##", xpath);
                Source xslSource = xmlConverter.toStreamSource(new StringReader(xslString));
                TransformerFactory transformerFactory = xmlConverter.createTransformerFactory();
                Transformer transformer = transformerFactory.newTransformer(xslSource);
                source = xmlConverter.toDOMSource(document);
                result = new DOMResult();

                transformer.setParameter("cacheValue", cacheValueDocument);
                transformer.transform(source, result);
            } finally {
View Full Code Here

Examples of org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMSource()

            SourceTransformer sourceTransformer = new SourceTransformer();
            // Only DOMSource and SAXSource are allowed for validating
            // See http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/validation/Validator.html#validate(javax.xml.transform.Source,%20javax.xml.transform.Result)
            // As we expect a DOMResult as output, we must ensure that the input is a
            // DOMSource
            DOMSource src = sourceTransformer.toDOMSource(out.getContent());
            doValidation(validator,src,result);
            if (errorHandler.hasErrors()) {
                Fault fault = exchange.createFault();
               
                // set the schema and source document as properties on the fault
View Full Code Here

Examples of org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMSource()

                     */
                    if (errorHandler.supportsMessageFormat(DOMSource.class)) {
                        fault.setContent(
                                (DOMSource)errorHandler.getMessagesAs(DOMSource.class));
                    } else if (errorHandler.supportsMessageFormat(StringSource.class)) {
                        fault.setContent(sourceTransformer.toDOMSource(
                                (StringSource)errorHandler.getMessagesAs(StringSource.class)));
                    } else if (errorHandler.supportsMessageFormat(String.class)) {
                        fault.setContent(
                                sourceTransformer.toDOMSource(
                                        new StringSource(
View Full Code Here

Examples of org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMSource()

                    } else if (errorHandler.supportsMessageFormat(StringSource.class)) {
                        fault.setContent(sourceTransformer.toDOMSource(
                                (StringSource)errorHandler.getMessagesAs(StringSource.class)));
                    } else if (errorHandler.supportsMessageFormat(String.class)) {
                        fault.setContent(
                                sourceTransformer.toDOMSource(
                                        new StringSource(
                                                (String)errorHandler.getMessagesAs(String.class))));
                    } else {
                        throw new MessagingException("MessageAwareErrorHandler implementation " +
                                errorHandler.getClass().getName() +
View Full Code Here

Examples of org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMSource()

        writer.writeEndElement();
    }

    private void writeDetails(XMLStreamWriter writer, Source details) throws ParserConfigurationException, IOException, SAXException, TransformerException, XMLStreamException {
        SourceTransformer st = new SourceTransformer();
        DOMSource domDetails = st.toDOMSource(details);
        Node detailsNode = domDetails.getNode().getFirstChild();
        if ( SoapMarshaler.MULTIPLE_DETAILS_NODE_WRAPPER.equals(detailsNode.getNodeName()) ) {
            NodeList children = detailsNode.getChildNodes();
            for ( int i = 0; i < children.getLength(); i++ ) {
                Node node = children.item(i);
View Full Code Here

Examples of org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMSource()

          SourceTransformer sourceTransformer = new SourceTransformer();
          // Only DOMSource and SAXSource are allowed for validating
          // See http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/validation/Validator.html#validate(javax.xml.transform.Source,%20javax.xml.transform.Result)
          // As we expect a DOMResult as output, we must ensure that the input is a
          // DOMSource
          DOMSource src = sourceTransformer.toDOMSource(out.getContent());
          doValidation(validator,src,result);
            if (errorHandler.hasErrors()) {
                Fault fault = exchange.createFault();
               
                // set the schema and source document as properties on the fault
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.