Package javax.xml.transform.stream

Examples of javax.xml.transform.stream.StreamResult


       
        // system id not transformed by default transformer
        tr.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, document.getDoctype().getSystemId());
       
        // Serialize XML Document
        tr.transform(new DOMSource(document), new StreamResult(strWriter));
        return strWriter.toString();
    }
View Full Code Here


        tr.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
        tr.setOutputProperty(OutputKeys.VERSION,"1.0");
        tr.setOutputProperty(OutputKeys.ENCODING,"UTF-8");
       
//      Serialize XML Document
        tr.transform( new DOMSource(doc),new StreamResult(strWriter));   

//        try {
//            serializer = new XMLSerializer();
//            strWriter = new StringWriter();
//            outFormat = new OutputFormat();
View Full Code Here

          transformer.setParameter("package", "");
          transformer.setParameter("class", pkg);
        }
       

        transformer.transform(new DOMSource(document), new StreamResult(file));

        dialog.dispose();
      } else {
        File newFile = DialogUtils.showSaveFileDialog(dialog, "java");
        if (newFile != null) {
View Full Code Here

    if (null!=oProps) setParameters(oTransformer, oProps);

    StreamSource oStreamSrcXML = new StreamSource(oXMLInputStream);

    StreamResult oStreamResult = new StreamResult(oOutputStream);

    if (DebugFile.trace) DebugFile.writeln("Transformer.transform(StreamSource,StreamResult)");

    oTransformer.transform(oStreamSrcXML, oStreamResult);
View Full Code Here

    ByteArrayOutputStream oOutputStream = new ByteArrayOutputStream();
    ByteArrayInputStream oXMLInputStream = new ByteArrayInputStream(sXMLInput.getBytes(sEncoding));
    Transformer oTransformer = StylesheetCache.newTransformer(sStyleSheetPath);
    if (null!=oProps) setParameters(oTransformer, oProps);
    StreamSource oStreamSrcXML = new StreamSource(oXMLInputStream);
    StreamResult oStreamResult = new StreamResult(oOutputStream);
    if (DebugFile.trace) DebugFile.writeln("Transformer.transform(StreamSource,StreamResult)");
    oTransformer.transform(oStreamSrcXML, oStreamResult);
    oStreamSrcXML = null;
    oXMLInputStream.close();
    String sRetVal = oOutputStream.toString(sEncoding);
View Full Code Here

    Templates oTemplates = oFactory.newTemplates(oStreamSrc);
    Transformer oTransformer = oTemplates.newTransformer();

    if (null!=oProps) setParameters(oTransformer, oProps);
    StreamSource oStreamSrcXML = new StreamSource(oXMLInputStream);
    StreamResult oStreamResult = new StreamResult(oOutputStream);
    if (DebugFile.trace) DebugFile.writeln("Transformer.transform(StreamSource,StreamResult)");
    oTransformer.transform(oStreamSrcXML, oStreamResult);
    oStreamSrcXML = null;
    oXMLInputStream.close();
    String sRetVal = oOutputStream.toString(sEncoding);
View Full Code Here

        }

        if (aHtmlOutput instanceof Node) {
            tOutputTarget = new DOMResult((Node)aHtmlOutput);
        } else if (aHtmlOutput instanceof OutputStream) {
            tOutputTarget = new StreamResult((OutputStream)aHtmlOutput);
        } else if (aHtmlOutput instanceof Writer) {
            tOutputTarget = new StreamResult((Writer)aHtmlOutput);
        } else {
            throw new IllegalArgumentException("HTMLwithXSLBuilder2::transform : Illegal argument for HTML output");
        }

      try {
View Full Code Here

    try
    {
      MozillaParser parser = new MozillaParser();
      Document doc = parser.parse( htmlBytes, htmlEncoding );

      TransformerFactory.newInstance().newTransformer().transform(new DOMSource(doc), new StreamResult(System.out));
      System.out.println("");
    }
    catch( Exception ex )
    {
     
View Full Code Here

  {
    String xmlNew = null;
    StringReader source = new StringReader(xmlOld);
    StreamSource streamSource = new StreamSource(source);
    StringWriter result = new StringWriter();
    StreamResult streamResult = new StreamResult(result);

    try
    {
      Transformer transformer = getXSLTransformer(xslFile);
      transformer.transform(streamSource, streamResult);
View Full Code Here

         return in;
      }
      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();
      }
   }
View Full Code Here

TOP

Related Classes of javax.xml.transform.stream.StreamResult

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.