DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42822>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42822

           Summary: Entity resolution in JSP documents
           Product: Tomcat 5
           Version: 5.0.23
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


It is not currently possible to use entity references in JSP Documents in a
reasonable way.  A JSP such as this:

<jsp:root
 version='2.0'
 xmlns:jsp='http://java.sun.com/JSP/Page'>

  <html>
    <head>
      <title>The test page</title>
    </head>
    <body>
      And here it is:&nbsp;
    </body>
  </html>
</jsp:root>

will quite naturally fail to parse.  But while one might expect to be able to
include a doctype declaration with an appropriate entity decl, that doesn't work
 either.  That is, if you try

<!DOCTYPE jsp:root 
[
  <!ENTITY nbsp "&#160;" >
]>
<jsp:root
 version='2.0'
 xmlns:jsp='http://java.sun.com/JSP/Page'>

  ... &nbsp; ...
</jsp:root>

Jasper says: Element type "jsp:root" must be declared.

This is apparently because Jasper's parser turns on validation when it sees any
sort of DTD at all (see JspDocumentParser:1413), and since there's no external
DTD provided all elements are going to fail validation.

I can see the logic here, but it seems to go too far.  It is not necessarily the
case that if I've provided a DTD, I want validation.  Entity resolution can
happen w/o validation, so all that needs to happen is to allow the parse to
continue in non-validating mode.

I gather that the "solution" is to not actually use entity references, but
instead to use something like &amp;nbsp; and let the browser resolve the
"reference".  I find this confusing, to say the least.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to