Package javax.xml.transform

Examples of javax.xml.transform.Transformer.transform()


      }
      else {
         StreamSource xmlStreamSource = new StreamSource(new ByteArrayInputStream(in));
         ByteArrayOutputStream baos = new ByteArrayOutputStream(in.length);
         StreamResult resultStream = new StreamResult(baos);
         transformer.transform(xmlStreamSource, resultStream);
         return baos.toByteArray();
      }
   }
  
   public InputStream doXSLTransformation(String filename, InputStream in,
View Full Code Here


         return in;
      } else {
         StreamSource xmlStreamSource = new StreamSource(in);
         ByteArrayOutputStream baos = new ByteArrayOutputStream(2048);
         StreamResult resultStream = new StreamResult(baos);
         transformer.transform(xmlStreamSource, resultStream);
         ByteArrayInputStream bin = new ByteArrayInputStream(baos.toByteArray());
         return bin;
      }
   }
  
View Full Code Here

        DOMSource response = new DOMSource();
        try {
            System.out.println("Incoming Client Request as a DOMSource data in PAYLOAD Mode");
            Transformer transformer = TransformerFactory.newInstance().newTransformer();
            StreamResult result = new StreamResult(System.out);
            transformer.transform(request, result);
            System.out.println("\n");
           
            InputStream is = getClass().getResourceAsStream("GreetMeDocLiteralResp3.xml");
           
            SOAPMessage greetMeResponse =  MessageFactory.newInstance().createMessage(null, is);
View Full Code Here

                it.setOutputProperty("{http://xml.apache.org/xslt}indent-amount",
                                     Integer.toString(this.indent));
            }
            it.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, omitXmlDecl);
            it.setOutputProperty(OutputKeys.ENCODING, charset);
            it.transform(new DOMSource(node), new StreamResult(os));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
   
View Full Code Here

           
            it.setOutputProperty(OutputKeys.METHOD, "xml");
            it.setOutputProperty(OutputKeys.INDENT, "yes");
            it.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
            it.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
            it.transform(new DOMSource(element), new StreamResult(writer));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

        // Realizar la transformación
        if (DebugFile.trace)
          DebugFile.writeln("oTransformer.transform(oStreamSrcXML, oStreamResult)");

        oTransformer.setParameter("param_page", ((Page)(vPages.get(c))).getTitle());
        oTransformer.transform(oStreamSrcXML, oStreamResult);

    if (!new File(oCurrentPage.filePath()).exists()) {
          if (DebugFile.trace) {
            DebugFile.writeln("FileNotFoundException: PageSet.buildSite() could not create file "+oCurrentPage.filePath());
            DebugFile.decIdent();
View Full Code Here

        // Paso el title de la pagina como parametro
        oTransformer.setParameter ("param_page", oCurrentPage.getTitle());

        // Realizar la transformación
        oTransformer.transform (oStreamSrcXML, oStreamResult);

      }
      catch (TransformerConfigurationException e) {
         oLastXcpt = e;
         sMedia = null;
View Full Code Here

      Transformer serializer = getSerializer(systemID);
      ByteArrayOutputStream outStream = new ByteArrayOutputStream();

      try
      {
        serializer.transform(new DOMSource(doc), new StreamResult(
            outStream));
        xmlData = outStream.toString(Constants.getXMLEncoding());
        outStream.close();

        // The serializer contains a bug and replaces DOS line breaks
View Full Code Here

            .item(0);
    }

    public void transform(InputStream stylesheet, OutputStream out) throws TransformerException {
        Transformer trans = TransformerFactory.newInstance().newTransformer(new StreamSource(stylesheet));
        trans.transform(new DOMSource(doc), new StreamResult(out));
    }

    public Element getPipeline() {
        NodeList nl = doc.getDocumentElement().getElementsByTagNameNS(Tool.TOOL_SPEC_PUBLIC_ID, "pipeline");
View Full Code Here

                Transformer serializer = TransformerFactory.newInstance()
                    .newTransformer(
                                    new StreamSource(Tool.class
                                        .getResourceAsStream("indent-no-xml-declaration.xsl")));

                serializer.transform(new DOMSource(resultDoc), new StreamResult(new PrintStream(System.out)));
            } catch (Exception ex) {
                LOG.log(Level.SEVERE, "ERROR_SERIALIZE_COMMAND_MSG", ex);
            }
        }
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.