Package javax.xml.transform

Examples of javax.xml.transform.Result


        FileUtils.copy(is, os);                                                    // copy old version for access in the meantime
      } catch (Exception e) {
        // initial call of this method or fs error: catalog.xml not found, so don't copy it, that's ok
      }
      os = new BufferedOutputStream(new FileOutputStream(f));
      Result dest = new StreamResult(os);
      inAccess = true;
      t.transform(src, dest);                                                    // and that's it
      inAccess = false;
      Tracing.logDebug("                                ...done", CatalogExportModuleDispatcher.class);
    } catch (Exception e) {
View Full Code Here


        return document;
    }

    private void transform(Document document) throws TransformerConfigurationException, TransformerException {
        Source source = new DOMSource(document);
        Result result = new StreamResult(writer);
        Transformer transformer = TransformerFactory.newInstance().newTransformer();
        transformer.setOutputProperty(OutputKeys.INDENT, "yes");
        transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
        transformer.transform(source, result);
    }
View Full Code Here

            //Write doc
            preset.writeXML(document);

            //Write XML file
            Source source = new DOMSource(document);
            Result result = new StreamResult(FileUtil.toFile(presetFile));
            Transformer transformer = TransformerFactory.newInstance().newTransformer();
            transformer.setOutputProperty(OutputKeys.INDENT, "yes");
            transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
            transformer.transform(source, result);
        } catch (Exception e) {
View Full Code Here

          source.setSystemId(getCanonicalURL(pageContext, _xmlSystemId));
        else
          source.setSystemId(((HttpServletRequest) pageContext.getRequest()).getRequestURI());
      }

      Result result;
      Node top = null;

      if (_result != null) {
        result = (Result) _result;
      }
View Full Code Here

        }

        DOMSource domSource = new DOMSource(doc);
        domSource.setSystemId(userPath.getUserPath());

        Result result = getResult(res.getOutputStream());

        transformer.transform(domSource, result);
      } catch (IOException e) {
        throw e;
      } catch (Exception e) {
View Full Code Here

        source = new StreamSource(bodyContent.getReader());
        source.setSystemId(((HttpServletRequest) pageContext.getRequest()).getRequestURI());
      }

      Result result;
      Node top = null;

      if (_result != null) {
        result = (Result) _result.evalObject(env);
      }
View Full Code Here

  }

  public void generateSchema(SchemaOutputResolver outputResolver)
    throws IOException
  {
    Result result = outputResolver.createOutput("", "schema1.xsd");

    XMLStreamWriter out = null;
   
    try {
      XMLOutputFactory factory = getXMLOutputFactory();
View Full Code Here

      // Result was supplied, the filename is relative to the source document.
      // When transforming with a SAXResult or DOMResult, call
      // TransformerImpl.setOutputTarget() to set the desired Result base.
  //      String base = urlToFileName(elem.getStylesheet().getSystemId());

      Result outputTarget = transformer.getOutputTarget();
      if ( (null != outputTarget) && ((base = outputTarget.getSystemId()) != null) ) {
        base = urlToFileName(base);
      }
      else
      {
        base = urlToFileName(transformer.getBaseURLOfSource());
View Full Code Here

            throws SAXException, RepositoryException {
        try {
            byte[] xml = remote.exportSystemView(path, binaryAsLink, noRecurse);

            Source source = new StreamSource(new ByteArrayInputStream(xml));
            Result result = new SAXResult(handler);

            TransformerFactory factory = TransformerFactory.newInstance();
            Transformer transformer = factory.newTransformer();
            transformer.transform(source, result);
        } catch (RemoteException ex) {
View Full Code Here

            throws SAXException, RepositoryException {
        try {
            byte[] xml = remote.exportDocumentView(path, binaryAsLink, noRecurse);

            Source source = new StreamSource(new ByteArrayInputStream(xml));
            Result result = new SAXResult(handler);

            TransformerFactory factory = TransformerFactory.newInstance();
            Transformer transformer = factory.newTransformer();
            transformer.transform(source, result);
        } catch (RemoteException ex) {
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.