Package org.jdom.transform

Examples of org.jdom.transform.XSLTransformer.transform()


  public void XmlTransformation(OutputStream out, Document doc, String filename) throws XSLTransformException, IOException {
    Document docTrans = new Document();
    if (filename != null && filename.equals("")) {
      XSLTransformer transformer;
      transformer = new XSLTransformer(filename);
      docTrans = transformer.transform(doc);
    } else {
      docTrans = doc;
    }
    Format format = Format.getPrettyFormat();
    format.setEncoding("utf-8");
View Full Code Here


    Document outputXML = null;

    XSLTransformer transformer;
    try {
      transformer = new XSLTransformer(xsltFile);
      outputXML = transformer.transform(inputXML);
    }
    catch(XSLTransformException e) {
      e.printStackTrace();
    }
    return outputXML;
View Full Code Here

                inputStream = new ByteArrayInputStream(stream.getData());
            }
            XSLTransformer xslTransformer = new XSLTransformer(xsl);
            SAXBuilder saxBuilder = new SAXBuilder(false);
            Document document = saxBuilder.build(inputStream);
            Document document1 = xslTransformer.transform(document);
            XMLOutputter xmlOutputter = new XMLOutputter(Format.getPrettyFormat());
            xmlOutputter.output(document1, outputStream);
        }
    }
View Full Code Here

            Logger.getLogger(XmlFormatter.class.getName()).log(Level.SEVERE, "Resource could not be loaded: " + resource);
            throw new XSLTransformException("Resource could not be loaded: " + resource);
        }
        XSLTransformer transformer = new XSLTransformer(in);
       
        Document foDoc = transformer.transform(sourceDoc);
        return foDoc;
    }
   
    public static void convertFo2Pdf(Document fo, OutputStream out) throws FileNotFoundException, FOPException, TransformerConfigurationException, TransformerException {
        // Setup input stream
View Full Code Here

            Logger.getLogger(XmlFormatter.class.getName()).log(Level.SEVERE, "Resource could not be loaded: " + resource);
            throw new XSLTransformException("Resource could not be loaded: " + resource);
        }
        XSLTransformer transformer = new XSLTransformer(in);
       
        Document foDoc = transformer.transform(sourceDoc);
        return foDoc;
    }
   
    public static void convertFo2Pdf(Document fo, OutputStream out) throws FileNotFoundException, FOPException, TransformerConfigurationException, TransformerException {
        // Setup input stream
View Full Code Here

            throw new CrosswalkInternalException("Failed to initialize transformer, probably error loading stylesheet.");

        try
        {
            Document ddim = new Document(getDim(item));
            Document result = xform.transform(ddim);
            return result.getRootElement();
        }
        catch (XSLTransformException e)
        {
            log.error("Got error: "+e.toString());
View Full Code Here

        if (xform == null)
            throw new CrosswalkInternalException("Failed to initialize transformer, probably error loading stylesheet.");

        try
        {
            return xform.transform(getDim(item).getChildren());
        }
        catch (XSLTransformException e)
        {
            log.error("Got error: "+e.toString());
            throw new CrosswalkInternalException("XSL translation failed: "+e.toString());
View Full Code Here

        XSLTransformer xform = getTransformer(DIRECTION);
        if (xform == null)
            throw new CrosswalkInternalException("Failed to initialize transformer, probably error loading stylesheet.");
        try
        {
            List dimList = xform.transform(metadata);
            applyDim(dimList, item);
        }
        catch (XSLTransformException e)
        {
            log.error("Got error: "+e.toString());
View Full Code Here

        XSLTransformer xform = getTransformer(DIRECTION);
        if (xform == null)
            throw new CrosswalkInternalException("Failed to initialize transformer, probably error loading stylesheet.");
        try
        {
            Document dimDoc = xform.transform(new Document((Element)root.clone()));
            applyDim(dimDoc.getRootElement().getChildren(), item);
        }
        catch (XSLTransformException e)
        {
            log.error("Got error: "+e.toString());
View Full Code Here

        XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
        Document dimDoc = null;
        List dimList = null;
        if (list)
        {
            dimList = xform.transform(inDoc.getRootElement().getChildren());
            outputter.output(dimList, System.out);
        }
        else
        {
            dimDoc = xform.transform(inDoc);
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.