Package nu.xom.xslt

Examples of nu.xom.xslt.XSLTransform


    procInstructions = new ArrayList<ProcessingInstruction>();
    this.pubXMLDoc = pubXML;
    XOMTools.setNamespaceURIRecursively(pubXML.getRootElement(), null);
    addNodeIds(pubXML.getRootElement(), pubXML.getRootElement());
    Document stylesheet = rg.getXMLDocument("rsc_art2paper_rng.xsl");
    xslt = new XSLTransform(stylesheet);
    sciXMLDoc = XSLTransform.toDocument(xslt.transform(pubXML));
    cleanSciXMLDoc = (Document)XOMTools.safeCopy(sciXMLDoc);
    xpc = new TreeMap<String, String>(new XPointComparator());
    Nodes n = sciXMLDoc.query("//*[@nodeID]");
    for(int i=0;i<n.size();i++) {
View Full Code Here


  private static HTMLToSciXML myInstance;
 
  private XSLTransform xslt;
 
  private HTMLToSciXML() throws Exception {
    xslt = new XSLTransform(rg.getXMLDocument("htmlToSciXML.xsl"));
  }
View Full Code Here

    if(myInstance == null) myInstance = new SnippetCompare();
    return myInstance;
  }

  private SnippetCompare() throws Exception {
    xslt = new XSLTransform(rg.getXMLDocument("canonicaliser.xsl"));
  }
View Full Code Here

                       getRealPath("/WEB-INF/data/CoreNLP-to-HTML.xsl");

    try {
      Builder builder = new Builder();
      Document stylesheet = builder.build(new File(xslPath));
      corenlpTransformer = new XSLTransform(stylesheet);
    } catch (Exception e) {
      throw new ServletException(e);
    }
  }
View Full Code Here

        + "</html>\n";
   
        Builder builder = new Builder();
        Document stylesheet = builder.build(literalResultElementAsStylesheet,
          "http://www.example.com");
        XSLTransform transform = new XSLTransform(stylesheet);
        Document doc = builder.build(notAStyleSheet,
              "http://www.example.com");
        Nodes result = transform.transform(doc);
        Element root = (Element) (result.get(0));
        assertEquals("html", root.getQualifiedName());
        assertEquals(2, root.getChildCount());
       
    }
View Full Code Here

        );
        File doc = new File(inputDir, "8-14.xml");
        File stylesheet = new File(inputDir, "fragment.xsl");
        Builder builder = new Builder();
        Document stylesheetDoc = builder.build(stylesheet);
        XSLTransform xform = new XSLTransform(stylesheetDoc);
        Document input = builder.build(doc);
        Nodes output = xform.transform(input);
        assertEquals(6, output.size());
        assertEquals(element1, output.get(0));
        assertEquals(element2, output.get(1));
        assertEquals(new Element("element4"), output.get(3));
        assertEquals(new Comment("test"), output.get(4));
View Full Code Here

       
        File doc = new File(inputDir, "8-1.xml");
        File stylesheet = new File(inputDir, "8-8.xsl");
        Builder builder = new Builder();
        Document stylesheetDoc = builder.build(stylesheet);
        XSLTransform xform = new XSLTransform(stylesheetDoc);
        Nodes output = xform.transform(builder.build(doc));
        assertEquals(1, output.size());
        Document result = new Document((Element) (output.get(0)));

        Document expected = builder.build("data/xslt/output/8-8.xml");
        assertEquals(expected, result);
View Full Code Here

       
        File doc = new File(inputDir, "8-1.xml");
        File stylesheet = new File(inputDir, "paramtest.xsl");
        Builder builder = new Builder();
        Document stylesheetDoc = builder.build(stylesheet);
        XSLTransform xform = new XSLTransform(stylesheetDoc);
        xform.setParameter("test", new Double(2));
        Nodes output = xform.transform(builder.build(doc));
        assertEquals(1, output.size());
        Element result = (Element) output.get(0);
        assertEquals("<root>2</root>", result.toXML());
       
    }
View Full Code Here

       
        File doc = new File(inputDir, "8-1.xml");
        File stylesheet = new File(inputDir, "namespaceparamtest.xsl");
        Builder builder = new Builder();
        Document stylesheetDoc = builder.build(stylesheet);
        XSLTransform xform = new XSLTransform(stylesheetDoc);
        xform.setParameter("test", "http://www.xom.nu/", new Double(2));
        Nodes output = xform.transform(builder.build(doc));
        assertEquals(1, output.size());
        Element result = (Element) output.get(0);
        assertEquals("<root xmlns:pre=\"http://www.xom.nu/\">2</root>",
            result.toXML());
       
View Full Code Here

       
        File doc = new File(inputDir, "8-1.xml");
        File stylesheet = new File(inputDir, "namespaceparamtest.xsl");
        Builder builder = new Builder();
        Document stylesheetDoc = builder.build(stylesheet);
        XSLTransform xform = new XSLTransform(stylesheetDoc);
        xform.setParameter("test", "http://www.xom.nu/", new Double(2));
        xform.setParameter("test", "http://www.xom.nu/", null);
        Nodes output = xform.transform(builder.build(doc));
        assertEquals(1, output.size());
        Element result = (Element) output.get(0);
        assertEquals("<root xmlns:pre=\"http://www.xom.nu/\">1</root>",
            result.toXML());
       
View Full Code Here

TOP

Related Classes of nu.xom.xslt.XSLTransform

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.