Package javax.xml.transform

Examples of javax.xml.transform.Result


     */
    public void transform(String xslName, Reader in, Writer out)
            throws Exception
    {
        Source xmlin = new StreamSource(in);
        Result xmlout = new StreamResult(out);

        transform(xslName, xmlin, xmlout, null);
    }
View Full Code Here


     */
    public void transform (String xslName, Node in, Writer out)
            throws Exception
    {
        Source xmlin = new DOMSource(in);
        Result xmlout = new StreamResult(out);

        transform(xslName, xmlin, xmlout, null);
    }
View Full Code Here

     */
    public void transform(String xslName, Reader in, Writer out, Map params)
            throws Exception
    {
        Source xmlin = new StreamSource(in);
        Result xmlout = new StreamResult(out);

        transform(xslName, xmlin, xmlout, params);
    }
View Full Code Here

     */
    public void transform (String xslName, Node in, Writer out, Map params)
            throws Exception
    {
        Source xmlin = new DOMSource(in);
        Result xmlout = new StreamResult(out);

        transform(xslName, xmlin, xmlout, params);
    }
View Full Code Here

      AbderaSource xsltSource = new AbderaSource(xslt);
      Transformer transformer = factory.newTransformer(xsltSource);
      Document<Feed> feed = getParser().parse(FOMTest.class.getResourceAsStream("/simple.xml"));
      AbderaSource feedSource = new AbderaSource(feed);
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      Result result = new StreamResult(out);
      transformer.transform(feedSource, result);
      assertEquals(out.toString(), "This is a test urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6");
     
      // Apply an XSLT transform to XML in the content element
      xslt = getParser().parse(FOMTest.class.getResourceAsStream("/content.xslt"));
View Full Code Here

            t.setParameter("pageTitle", pageTitle);
            t.setParameter("slingScriptPath", fullPath(request,SLING_JS_PATH));
            t.setParameter("jstScriptPath", fullPath(request, scriptPath + ".jst.js"));
            t.setParameter("defaultRendering", defaultRendering.toString());
            t.setParameter("jsonData", jsonData.toString());
            final Result result = new StreamResult(output);
            final DOMSource source = new DOMSource(template);
            t.transform(source, result);

        } catch (Exception e) {
            final ScriptException se = new ScriptException("Error in XSLT transform for " + scriptPath);
View Full Code Here

    }

    String nodeToString(Node rootNode) {

        StringWriter out = new StringWriter();
        Result result = new StreamResult(out);

        Source source = new DOMSource(rootNode);

        try {
            Transformer xformer = TransformerFactory.newInstance().newTransformer();
View Full Code Here

        }
    }

  @Test
    public void receiverFault() {
        Result result = new StringResult();
        try {
            template.sendSourceAndReceiveToResult(baseUrl + "/soap/receiverFault", new StringSource(messagePayload),
                    result);
            Assert.fail("SoapFaultClientException expected");
        }
View Full Code Here

        }
    }

  @Test
    public void senderFault() {
        Result result = new StringResult();
        try {
            template.sendSourceAndReceiveToResult(baseUrl + "/soap/senderFault", new StringSource(messagePayload),
                    result);
            Assert.fail("SoapFaultClientException expected");
        }
View Full Code Here

        }
    }

  @Test
    public void fault() {
        Result result = new StringResult();
        try {
            template.sendSourceAndReceiveToResult(baseUrl + "/soap/fault", new StringSource(messagePayload),
                    result);
            Assert.fail("SoapFaultClientException expected");
        }
View Full Code Here

TOP

Related Classes of javax.xml.transform.Result

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.