Search in sources :

Example 1 with EntityResolver

use of org.thymeleaf.templateparser.EntityResolver in project thymeleaf-tests by thymeleaf.

the class AbstractDocumentProcessingTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    this.templateEngine = new TemplateEngine();
    TemplateResolver templateResolver = new ClassLoaderTemplateResolver();
    templateResolver.setSuffix(".html");
    this.templateEngine.setTemplateResolver(templateResolver);
    this.templateEngine.initialize();
    this.context = new Context();
    XPathFactory xPathFactory = XPathFactory.newInstance();
    this.xPath = xPathFactory.newXPath();
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    this.docBuilder = factory.newDocumentBuilder();
    this.docBuilder.setEntityResolver(new EntityResolver(this.templateEngine.getConfiguration()));
}
Also used : IContext(org.thymeleaf.context.IContext) Context(org.thymeleaf.context.Context) TemplateEngine(org.thymeleaf.TemplateEngine) ClassLoaderTemplateResolver(org.thymeleaf.templateresolver.ClassLoaderTemplateResolver) XPathFactory(javax.xml.xpath.XPathFactory) ClassLoaderTemplateResolver(org.thymeleaf.templateresolver.ClassLoaderTemplateResolver) TemplateResolver(org.thymeleaf.templateresolver.TemplateResolver) DocumentBuilderFactory(javax.xml.parsers.DocumentBuilderFactory) EntityResolver(org.thymeleaf.templateparser.EntityResolver)

Aggregations

DocumentBuilderFactory (javax.xml.parsers.DocumentBuilderFactory)1 XPathFactory (javax.xml.xpath.XPathFactory)1 TemplateEngine (org.thymeleaf.TemplateEngine)1 Context (org.thymeleaf.context.Context)1 IContext (org.thymeleaf.context.IContext)1 EntityResolver (org.thymeleaf.templateparser.EntityResolver)1 ClassLoaderTemplateResolver (org.thymeleaf.templateresolver.ClassLoaderTemplateResolver)1 TemplateResolver (org.thymeleaf.templateresolver.TemplateResolver)1