Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 5.0
    • Fix Version/s: 5.0.4
    • Component/s: None
    • Labels:
      None

      Description

      Using HTML entities in T5 templates (like  ) causes an exception:

      Failure parsing template classpath:com/of/components/Border.html: The entity "nbsp" was referenced, but not declared.

      • org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1183)
      • org.apache.tapestry.internal.services.TemplateParserImpl.parseTemplate(TemplateParserImpl.java:161)
      • $TemplateParser_110b25178d4.parseTemplate($TemplateParser_110b25178d4.java)
      • $TemplateParser_110b25178d5.parseTemplate($TemplateParser_110b25178d5.java)
      • $TemplateParser_110b25178ca.parseTemplate($TemplateParser_110b25178ca.java)
      • org.apache.tapestry.internal.services.ComponentTemplateSourceImpl.parseTemplate(ComponentTemplateSourceImpl.java:145)
      • org.apache.tapestry.internal.services.ComponentTemplateSourceImpl.getTemplate(ComponentTemplateSourceImpl.java:126)
      • $ComponentTemplateSource_110b25178cc.getTemplate($ComponentTemplateSource_110b25178cc.java)
      • $ComponentTemplateSource_110b2517897.getTemplate($ComponentTemplateSource_110b2517897.java)
      • org.apache.tapestry.internal.services.PageLoaderProcessor.loadTemplateForComponent(PageLoaderProcessor.java:350)
      • org.apache.tapestry.internal.services.PageLoaderProcessor.workComponentQueue(PageLoaderProcessor.java:628)
      • org.apache.tapestry.internal.services.PageLoaderProcessor.loadPage(PageLoaderProcessor.java:316)
      • org.apache.tapestry.internal.services.PageLoaderImpl.loadPage(PageLoaderImpl.java:62)
      • $PageLoader_110b25178c8.loadPage($PageLoader_110b25178c8.java)
      • $PageLoader_110b25178c6.loadPage($PageLoader_110b25178c6.java)
      • org.apache.tapestry.internal.services.PagePoolImpl.checkout(PagePoolImpl.java:63)
      • $PagePool_110b25178cd.checkout($PagePool_110b25178cd.java)
      • $PagePool_110b25178c5.checkout($PagePool_110b25178c5.java)
      • org.apache.tapestry.internal.services.RequestPageCacheImpl.getByClassName(RequestPageCacheImpl.java:58)
      • org.apache.tapestry.internal.services.RequestPageCacheImpl.get(RequestPageCacheImpl.java:49)
      • $RequestPageCache_110b25178c3.get($RequestPageCache_110b25178c3.java)
      • $RequestPageCache_110b25178c4.get($RequestPageCache_110b25178c4.java)
      • $RequestPageCache_110b2517891.get($RequestPageCache_110b2517891.java)
      • org.apache.tapestry.internal.services.PageLinkHandlerImpl.handle(PageLinkHandlerImpl.java:46)
      • org.apache.tapestry.internal.services.PageLinkHandlerImpl.handle(PageLinkHandlerImpl.java:39)
      • $PageLinkHandler_110b25178c2.handle($PageLinkHandler_110b25178c2.java)
      • $PageLinkHandler_110b25178be.handle($PageLinkHandler_110b25178be.java)
      • org.apache.tapestry.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:88)
      • $Dispatcher_110b25178c0.dispatch($Dispatcher_110b25178c0.java)
      • $Dispatcher_110b25178c1.dispatch($Dispatcher_110b25178c1.java)
      • $Dispatcher_110b25178ad.dispatch($Dispatcher_110b25178ad.java)
      • org.apache.tapestry.services.TapestryModule$5.service(TapestryModule.java:418)
      • org.apache.tapestry.services.TapestryModule$6.service(TapestryModule.java:451)
      • $RequestHandler_110b25178ae.service($RequestHandler_110b25178ae.java)
      • org.apache.tapestry.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:49)
      • $RequestHandler_110b25178ae.service($RequestHandler_110b25178ae.java)
      • com.of.services.AppModule$1.service(AppModule.java:39)
      • $RequestFilter_110b25178aa.service($RequestFilter_110b25178aa.java)
      • $RequestHandler_110b25178ae.service($RequestHandler_110b25178ae.java)
      • org.apache.tapestry.internal.services.LocalizationFilter.service(LocalizationFilter.java:43)
      • $RequestHandler_110b25178ae.service($RequestHandler_110b25178ae.java)
      • org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:91)
      • org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:82)
      • org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:77)
      • org.apache.tapestry.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:104)
      • $RequestHandler_110b25178ae.service($RequestHandler_110b25178ae.java)
      • $RequestHandler_110b25178af.service($RequestHandler_110b25178af.java)
      • $RequestHandler_110b25178a5.service($RequestHandler_110b25178a5.java)
      • org.apache.tapestry.services.TapestryModule$3.service(TapestryModule.java:341)
      • $HttpServletRequestHandler_110b25178a6.service($HttpServletRequestHandler_110b25178a6.java)
      • $HttpServletRequestHandler_110b25178a4.service($HttpServletRequestHandler_110b25178a4.java)
      • org.apache.tapestry.TapestryFilter.doFilter(TapestryFilter.java:114)
      • org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
      • org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:354)
      • org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:226)
      • org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:615)
      • org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149)
      • org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:123)
      • org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
      • org.mortbay.jetty.Server.handle(Server.java:269)
      • org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:430)
      • org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:678)
      • org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:492)
      • org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:199)
      • org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:339)
      • org.mortbay.jetty.nio.HttpChannelEndPoint.run(HttpChannelEndPoint.java:270)
      • org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)

        Issue Links

          Activity

          Hide
          Howard M. Lewis Ship added a comment -

          The underlying cause of this problem is the use of an XML document to parse templates as well formed documents.

          HTML is not well formed XML, its a kind of SGML (on a good day).

          Perhaps we could use something like HTML tidy to "clean up" the HTML before passing it into the XML? This could be applied to templates based on meta-data.

          Worst case is we have to write our own XML-ish parser. But that sends us back to T4 style templates a bit, with all their problems.

          Show
          Howard M. Lewis Ship added a comment - The underlying cause of this problem is the use of an XML document to parse templates as well formed documents. HTML is not well formed XML, its a kind of SGML (on a good day). Perhaps we could use something like HTML tidy to "clean up" the HTML before passing it into the XML? This could be applied to templates based on meta-data. Worst case is we have to write our own XML-ish parser. But that sends us back to T4 style templates a bit, with all their problems.
          Hide
          Daniel Gredler added a comment -

          This issue is related to TAPESTRY-1264. For what it's worth, I'm using the XHTML 1.0 Strict DOCTYPE in my templates in order be able to use HTML entities, even though I don't want to serve up XHTML 1.0 Strict (I've patched my local version of T5 to serve up HTML 4.01 Strict DOCTYPE'ed pages).

          It hasn't been too painful... Maybe HTML templates have to be declared to be XHTML, but you can configure the final doctype elsewhere in the application?

          Show
          Daniel Gredler added a comment - This issue is related to TAPESTRY-1264 . For what it's worth, I'm using the XHTML 1.0 Strict DOCTYPE in my templates in order be able to use HTML entities, even though I don't want to serve up XHTML 1.0 Strict (I've patched my local version of T5 to serve up HTML 4.01 Strict DOCTYPE'ed pages). It hasn't been too painful... Maybe HTML templates have to be declared to be XHTML, but you can configure the final doctype elsewhere in the application?
          Hide
          Robert Zeigler added a comment -

          With Daniel's new patch (serving local versions of the doctypes), couldn't we map the html dtd's to their xml counterparts?
          Then, a template designer can use the html doctypes and tapestry will still merrily parse them (because it will be using
          local, xml versions of the DTD's). Just as long as it's the template-specified DTD that goes to the client...

          Robert

          Show
          Robert Zeigler added a comment - With Daniel's new patch (serving local versions of the doctypes), couldn't we map the html dtd's to their xml counterparts? Then, a template designer can use the html doctypes and tapestry will still merrily parse them (because it will be using local, xml versions of the DTD's). Just as long as it's the template-specified DTD that goes to the client... Robert
          Hide
          Daniel Gredler added a comment -

          That sounds fine to me, as long as it's documented and as long as we're 100% sure that (HTML4 + XML = XHTML1) for each of the types (strict, transitional, frameset).

          Show
          Daniel Gredler added a comment - That sounds fine to me, as long as it's documented and as long as we're 100% sure that (HTML4 + XML = XHTML1) for each of the types (strict, transitional, frameset).

            People

            • Assignee:
              Howard M. Lewis Ship
              Reporter:
              Daniel Gredler
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development