mikaelstaldal / LSP

Other
5 stars 2 forks source link

LSP fails on XHTML entities #17

Open Nowaker opened 13 years ago

Nowaker commented 13 years ago

LSP file:

&copy; <a href="http://www.nowaker.net/">Damian Nowak</a>

Stacktrace:

java.lang.RuntimeException: /home/nwkr/projekty/java/openrepublik/openrepublik-web/src/main/webapp/WEB-INF/views/layouts/basic/layout.lsp:49:11: The entity "copy" was referenced, but not declared.
    nu.staldal.lsp.spring.webmvc.LspHotCompilerHelper.doCompile(LspHotCompilerHelper.java:203)
    nu.staldal.lsp.spring.webmvc.LspView.compileLspPage(LspView.java:64)
    nu.staldal.lsp.spring.webmvc.LspView.compileOrReuseLspPageClass(LspView.java:54)
    nu.staldal.lsp.spring.webmvc.LspView.render(LspView.java:39)
    org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1047)```
mikaelstaldal commented 13 years ago

I'm aware of this issue, but I don't know any good way to solve it. It's a more general XML issue really.

LSP does only know XML, not XHTML, and the &copy; entity is defined in XHTML.

A workaround is to include the XHTML entity declaration DTD in the LSP file, something like this: <!DOCTYPE html [ <!ENTITY % lat1 SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent"> <!ENTITY % special SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent"> <!ENTITY % symbol SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent"> %lat1; %special; %symbol; ]>