Package javax.xml.transform

Examples of javax.xml.transform.Result


      MappedNamespaceConvention con = new MappedNamespaceConvention();
      XMLStreamWriter streamWriter = new ResultAdapter(con, writer);

      Source source = new DOMSource(root);
      //Result output = new StAXResult(streamWriter); JDK 6 only
      Result output = new SAXResult((ContentHandler)streamWriter);

      Transformer transformer = TransformerFactory.newInstance().newTransformer();
      transformer.transform(source, output);

      streamWriter.flush();
View Full Code Here


                        FileOutputStream out = new FileOutputStream(name);
                        Transformer transformer =
                            TransformerFactory.newInstance().newTransformer();
                        transformer.setOutputProperty("indent", "no");
                        DOMSource source = new DOMSource(schema);
                        Result result = new StreamResult(out);
                        transformer.transform(source, result);
                        out.close();
                        System.out.print("Wrote schema " + name);
                        if (tns.length() == 0) {
                            System.out.println(" for default namespace");
View Full Code Here

                    Hashtable aParamList)
        throws IllegalArgumentException
  {
      Source tXmlSource = null;
      Source tXslSource = null;
      Result tOutputTarget = null;

      // test and convert the flexible parameters
        if (aXmlInput instanceof Node) {
            // aXmlInput is a DOM object
            tXmlSource = new DOMSource((Node)aXmlInput);
View Full Code Here

                if (xslt != null)
                {
                    final Source xsltSource = new StreamSource(xslt.openStream());
                    final javax.xml.transform.Transformer transformer = factory.newTransformer(xsltSource);
                    final ByteArrayOutputStream output = new ByteArrayOutputStream();
                    final Result result = new StreamResult(output);
                    transformer.transform(
                        xmlSource,
                        result);
                    final byte[] outputResult = output.toByteArray();
                    if (StringUtils.isNotBlank(outputLocation))
View Full Code Here

                        {
                            AndroMDALogger.info("Applying transformation --> '" + xslt + "'");
                            final Source xsltSource = new StreamSource(xslt.openStream());
                            final javax.xml.transform.Transformer transformer = factory.newTransformer(xsltSource);
                            final ByteArrayOutputStream output = new ByteArrayOutputStream();
                            final Result result = new StreamResult(output);
                            transformer.transform(modelSource, result);
                            final byte[] outputResult = output.toByteArray();
                            stream = new ByteArrayInputStream(outputResult);
   
                            // if we have an output location specified, write the result
View Full Code Here

    }

    public Result createOutput(String namespaceUri, String suggestedFileName) {
        wmodel.addSchemaNSFileToMap(namespaceUri, suggestedFileName);
        File wsdlFile = getFile(suggestedFileName);
        Result result = null;
        try {
            result = new StreamResult(new FileOutputStream(wsdlFile));
            result.setSystemId(wsdlFile.toString().replace('\\', '/'));
        } catch (FileNotFoundException e) {
            Message msg = new Message("CANNOT_CREATE_SCHEMA_FILE", LOG);
            throw new ToolException(msg, e);
        }
        return result;
View Full Code Here

                if (xslt != null)
                {
                    final Source xsltSource = new StreamSource(xslt.openStream());
                    final javax.xml.transform.Transformer transformer = factory.newTransformer(xsltSource);
                    final ByteArrayOutputStream output = new ByteArrayOutputStream();
                    final Result result = new StreamResult(output);
                    transformer.transform(
                        xmlSource,
                        result);
                   
                    final byte[] outputResult = output.toByteArray();
View Full Code Here

      barcode.generateBarcode(provider, message);
      Document svgDoc = provider.getDOM();

      Source source = new DOMSource(svgDoc);
      StringWriter outWriter = new StringWriter();
      Result output = new StreamResult(outWriter);
      Transformer transformer = TransformerFactory.newInstance()
          .newTransformer();
      transformer.transform(source, output);

      String svgString = outWriter.toString();
View Full Code Here

     
      // Use an OutputStream rather than a File
      OutputStream out = new FileOutputStream(file);
     
      // Prepare the output
      Result result = new StreamResult(out);
     
      // Write the DOM document to the file
      Transformer xformer = TransformerFactory.newInstance().newTransformer();
     
      // Enable indentation
View Full Code Here

                InputStream dataStream = new FileInputStream(dataFile);
                InputStream styleStream = new FileInputStream(styleFile);
                // create XSLT Source and Result objects
                Source data = new StreamSource(dataStream);
                Source style = new StreamSource(styleStream);
                Result output = new StreamResult(System.out);
                // create Transformer and perform the tranfomation
                Transformer xslt =  TransformerFactory.newInstance().newTransformer(style);
                xslt.transform(data, output);
            }
            catch (Exception e) {
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.