Search in sources :

Example 1 with XSLTransform

use of nu.xom.xslt.XSLTransform in project CoreNLP by stanfordnlp.

the class CoreNLPServlet method init.

public void init() throws ServletException {
    pipeline = new StanfordCoreNLP();
    String xslPath = getServletContext().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);
    }
}
Also used : ServletException(javax.servlet.ServletException) Builder(nu.xom.Builder) Document(nu.xom.Document) File(java.io.File) StanfordCoreNLP(edu.stanford.nlp.pipeline.StanfordCoreNLP) ServletException(javax.servlet.ServletException) IOException(java.io.IOException) RuntimeIOException(edu.stanford.nlp.io.RuntimeIOException) XSLTransform(nu.xom.xslt.XSLTransform)

Aggregations

RuntimeIOException (edu.stanford.nlp.io.RuntimeIOException)1 StanfordCoreNLP (edu.stanford.nlp.pipeline.StanfordCoreNLP)1 File (java.io.File)1 IOException (java.io.IOException)1 ServletException (javax.servlet.ServletException)1 Builder (nu.xom.Builder)1 Document (nu.xom.Document)1 XSLTransform (nu.xom.xslt.XSLTransform)1