Examples of XSLTransformer


Examples of org.cast.cwm.xml.transform.XslTransformer

      studentXslFile = new File(getTransformationDir(), getStudentTransformationFile());
   
    // For comparing responses, need to filter down to a single response area and invoke custom XSL
    TransformChain compareChain = new TransformChain(
        new FilterElements(),
        new XslTransformer(xmlService.findXslResource("compare-responses.xsl")),
        new EnsureUniqueWicketIds());
    xmlService.registerTransformer("compare-responses", compareChain);

    // For viewing single-select response in whiteboard or notebook, need to filter down to a single response area and invoke custom XSL
    TransformChain viewChain = new TransformChain(
        new FilterElements(),
        new XslTransformer(xmlService.findXslResource("view-response.xsl")),
        new EnsureUniqueWicketIds());
    xmlService.registerTransformer("view-response", viewChain);
   
    // Construct transformation pipeline for student content: glossary -> XSL -> unique wicket:ids
    TransformChain transformchain = new TransformChain(
        new XslTransformer(xmlService.findXslResource("strip-class.xsl")),
        new GlossaryTransformer(glossary),
        new FilterElements(),
        new XslTransformer(new FileResource(studentXslFile)),
        new EnsureUniqueWicketIds());
    xmlService.registerTransformer("student", transformchain)
   
    if (emailOn) {
      // For sending emails to users
View Full Code Here

Examples of org.jdom.transform.XSLTransformer

   */

  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

Examples of org.jdom.transform.XSLTransformer

  // Alternative approach to last funciton
  public final static Document simpleTransformer(String xsltFile,
      Document inputXML) {
    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

Examples of org.jdom.transform.XSLTransformer

            fileCleaningTracker.track(stream.getFile(), inputStream);
            if (stream.isInMemory()) {
                inputStream.close();
                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

Examples of org.jdom.transform.XSLTransformer

        in = XmlFormatter.class.getResourceAsStream(resource);
        if (in == null) {
            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;
    }
View Full Code Here

Examples of org.jdom.transform.XSLTransformer

        in = XmlFormatter.class.getResourceAsStream(resource);
        if (in == null) {
            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;
    }
View Full Code Here

Examples of org.jdom.transform.XSLTransformer

        init();

        if (dso.getType() != Constants.ITEM)
            throw new CrosswalkObjectNotSupported("XSLTDisseminationCrosswalk can only crosswalk an Item.");
        Item item = (Item)dso;
        XSLTransformer xform = getTransformer(DIRECTION);
        if (xform == null)
            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

Examples of org.jdom.transform.XSLTransformer

        init();

        if (dso.getType() != Constants.ITEM)
            throw new CrosswalkObjectNotSupported("XSLTDisseminationCrosswalk can only crosswalk an Item.");
        Item item = (Item)dso;
        XSLTransformer xform = getTransformer(DIRECTION);
        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

Examples of org.jdom.transform.XSLTransformer

        {
            try
            {
                log.debug((transformer == null ? "Loading " : "Reloading")+
                          getPluginInstanceName()+" XSLT stylesheet from "+transformerFile.toString());
                transformer = new XSLTransformer(transformerFile);
                transformerLastModified = transformerFile.lastModified();
            }
            catch (XSLTransformException e)
            {
                log.error("Failed to initialize XSLTCrosswalk("+getPluginInstanceName()+"):"+e.toString());
View Full Code Here

Examples of org.jdom.transform.XSLTransformer

    {
        if (dso.getType() != Constants.ITEM)
            throw new CrosswalkObjectNotSupported("XsltSubmissionionCrosswalk can only crosswalk to an Item.");
        Item item = (Item)dso;

        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
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.