Package javax.xml.transform

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


    catch (Exception e) {
      logger.fatal(e.getMessage(), e);
      throw new IOException(e.getMessage());
    }
    try {
      transformer.transform(
        new StreamSource(iStream),
        new StreamResult(boutArray));
      return boutArray;
    }
    catch (Exception e) {
View Full Code Here


       
        // 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();
    }
   
    /**
     * @param Name
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

    StreamResult oStreamResult = new StreamResult(oOutputStream);

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

    oTransformer.transform(oStreamSrcXML, oStreamResult);

    if (DebugFile.trace) {
      DebugFile.writeln("done in " + String.valueOf(System.currentTimeMillis()-lElapsed) + " miliseconds");
      DebugFile.decIdent();
      DebugFile.writeln("End StylesheetCache.transform()");
View Full Code Here

    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);
    if (DebugFile.trace) {
      if (null==sRetVal)
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);
    oStreamSrcXML = null;
    oXMLInputStream.close();
    String sRetVal = oOutputStream.toString(sEncoding);
    if (DebugFile.trace) {
      if (null==sRetVal)
View Full Code Here

                }
            }

          // Use the transformer to apply the Stylesheet to an XML document
          // and write the output to the specified Result object.
          transformer.transform(tXmlSource, tOutputTarget);

         } catch(TransformerFactoryConfigurationError ex) {
            throw new ProgrammerException
                        ("HTMLwithXSLBuilder2: transform returns TransformerFactoryConfigurationError: " + ex.getMessage());
         } catch(TransformerConfigurationException ex) {
View Full Code Here

    DOMResult domResult = new DOMResult();

    try
    {
      Transformer transformer = getXSLTransformer(xslFile);
      transformer.transform(new DOMSource(xmlOld), domResult);
      xmlNew = (Document) domResult.getNode();
      applyStylets(xmlNew, message);
    }
    catch (TransformerConfigurationException e)
    {
View Full Code Here

    StreamResult streamResult = new StreamResult(result);

    try
    {
      Transformer transformer = getXSLTransformer(xslFile);
      transformer.transform(streamSource, streamResult);
      xmlNew = result.toString();
      source.close();
      result.close();
    }
    catch (IOException e)
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.