Package org.jdom.transform

Examples of org.jdom.transform.JDOMSource$DocumentReader


     * @throws Exception
     */
  public static void transform(Element xml, String styleSheetPath, Result result, Map<String, Object> params) throws Exception
  {
    File styleSheet = new File(styleSheetPath);
    Source srcXml   = new JDOMSource(new Document((Element)xml.detach()));
    Source srcSheet = new StreamSource(styleSheet);

    // Dear old saxon likes to yell loudly about each and every XSLT 1.0
    // stylesheet so switch it off but trap any exceptions because this
    // code is run on transformers other than saxon
View Full Code Here


    } finally {
       Transformer transformer = factory.newTransformer(xslt);

       // Step 5: Setup input and output for XSLT transformation
       // Setup input stream
      Source src = new JDOMSource(new Document((Element)xml.detach()));
  
       // Resulting SAX events (the generated FO) must be piped through to
       // FOP
       Result res = new SAXResult(fop.getDefaultHandler());
View Full Code Here

      Transformer transformer = TransformerFactory.newInstance()
          .newTransformer();
      transformer.setOutputProperty(OutputKeys.INDENT, "yes");
      StreamResult sresult = new StreamResult(new StringWriter());
      JDOMSource source = new JDOMSource(docOut);
      transformer.transform(source, sresult);
      String xmlString = sresult.getWriter().toString();
      result = xmlString;
      //IFXDocumentHandler.write(docOut,0,null,ostream);
    } catch (Exception e) {
View Full Code Here

        xsltProcessor.setTarget(targetFile);
               
        Document doc = new Document(treeWalker.eval(root, result));
       
        // TODO attempt to get error reporting for file / line !!
        Source s = new JDOMSource(doc);
        s.setSystemId(file.toURI().toString());
       
        return SAXSource.sourceToInputSource(s);
    }
    catch(Exception e) {
      throw new BuildException(e, getLocation());
View Full Code Here

TOP

Related Classes of org.jdom.transform.JDOMSource$DocumentReader

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.