Package org.dom4j.io

Examples of org.dom4j.io.DocumentSource


      Document doc = node.getDocument();
      if (doc == null) {
        doc = new DOMDocument();
        doc.add(node);
      }
      DocumentSource xmlsource = new DocumentSource(node);
     
      //ByteArrayOutputStream baos = new ByteArrayOutputStream();
      StringWriter sw = new StringWriter();
      StreamResult result = new StreamResult(sw);
      synchronized (transformer) {//o_clusterOK by:fj transformer is per vm
View Full Code Here


    }

    @Override
    protected Source createResponsePayload(MethodParameter returnType, Object returnValue) {
        Element returnedElement = (Element) returnValue;
        return new DocumentSource(returnedElement);
    }
View Full Code Here

            transform(request, dom4jResult);
            requestElement = dom4jResult.getDocument().getRootElement();
        }
        Document responseDocument = DocumentHelper.createDocument();
        Element responseElement = invokeInternal(requestElement, responseDocument);
        return responseElement != null ? new DocumentSource(responseElement) : null;
    }
View Full Code Here

            // return original document
            return document;
        }

        // now lets style the given document
        DocumentSource source = new DocumentSource( document );
        DocumentResult result = new DocumentResult();
        try
        {
            transformer.transform( source, result );
        }
View Full Code Here

    // Create a transformer using the stylesheet
    final Transformer transformer = TransformerFactory.newInstance().newTransformer(xsl);

    // Source document is the XML generated from the BugCollection
    final Source source = new DocumentSource(document);

    // Write result to output stream
    final OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(fileName), Charset.forName("UTF-8").newEncoder());
    final Result result = new StreamResult(writer);
    // Do the transformation
View Full Code Here

            // return original document
            return document;
        }

        // now lets style the given document
        DocumentSource source = new DocumentSource( document );
        DocumentResult result = new DocumentResult();
        try
        {
            transformer.transform( source, result );
        }
View Full Code Here

            // return original document
            return document;
        }

        // now lets style the given document
        DocumentSource source = new DocumentSource( document );
        DocumentResult result = new DocumentResult();
        try
        {
            transformer.transform( source, result );
        }
View Full Code Here

            // Create a transformer using the stylesheet
            TransformerFactory factory = TransformerFactory.newInstance();
            Transformer transformer = factory.newTransformer(xsl);

            // Source document is the XML generated from the BugCollection
            DocumentSource source = new DocumentSource(document);

            // Write result to output stream
            StreamResult result = new StreamResult(outputStream);

            // Do the transformation
View Full Code Here

    TransformerFactory factory = TransformerFactory.newInstance();
    Transformer transformer = factory.newTransformer(
        new StreamSource( this.getClass().getResourceAsStream( STYLESHEET_NAME ) ) );

    // apply the conversion stylesheet to the incoming process definition
    DocumentSource source = new DocumentSource( document );
    DocumentResult result = new DocumentResult();
    transformer.transform( source, result );

    // return the transformed document
    
View Full Code Here

                return new StreamSource(new StringReader((String) src));
            }
        }
        else if (src instanceof org.dom4j.Document)
        {
            return new DocumentSource((org.dom4j.Document) src);
        }
        else if (src instanceof org.xml.sax.InputSource)
        {
            return new SAXSource((InputSource) src);
        }
View Full Code Here

TOP

Related Classes of org.dom4j.io.DocumentSource

Copyright © 2018 www.massapicom. 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.