facebook

Invalid location of tag (td)

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #220610 Reply

    Wim Goossens
    Member

    Hi,

    I get an ‘Invalid location of tag (td)’ warning when using jsp fragments.

    MyEclipse 3.8.2 QF 20041020
    Eclipse 3.0.1 Build id: 200409161125

    Source code to reproduce (3 files):

    1. xbegin.jspf :

    <table>
    <tr>

    2. xend.jspf :

    </tr>
    </table>

    3. xmain.jsp :

    <jsp:root
    xmlns:jsp=”http://java.sun.com/JSP/Page&#8221;
    version=”2.0″>
    <jsp:output doctype-root-element=”html”
    doctype-public=”-//W3C//DTD XHTML 1.1//EN”
    doctype-system=”http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&#8221; />
    <jsp:directive.page contentType=”text/html” />
    <html>
    <head>
    <jsp:element name=”title”>
    <jsp:body>xmain</jsp:body>
    </jsp:element>
    </head>
    <body>
    <jsp:directive.include file=”xbegin.jspf” />
    <td>test</td>
    <jsp:directive.include file=”xend.jspf” />
    </body>
    </html>
    </jsp:root>

    It would be nice without this warning.

    Regards,
    Wim

    #220612 Reply

    Riyad Kalla
    Member

    Wim,
    I suggest turning off HTML validation if you are using includes in this fashion. The HTML validator is pretty picky and expects strict HTML 4.01 which almost no one does 😉

    #220616 Reply

    Wim Goossens
    Member

    Riyad,

    When you have got the time, could you clarify this a little bit more ?

    Regards,
    Wim

    #220622 Reply

    Riyad Kalla
    Member

    Wim,
    Clarify which part? How to turn the validator off or why?

    #220641 Reply

    Wim Goossens
    Member

    Riyad,

    My problem is that the result of this code :

    <jsp:directive.include file=”xbegin.jspf” />
    <td>test</td>
    <jsp:directive.include file=”xend.jspf” />

    <jsp:directive.include … is just a static file include, so I think the
    html validator sees this code :

    <table>
    <tr>
    <td>test</td>
    </tr>
    </table>

    I don’t see what the problem is with this code for the html validator ?

    Regards
    Wim

    #220645 Reply

    Riyad Kalla
    Member

    Wim,
    This is one of the reasons I was suggesting to turn off the HTML validator, the HTML you have above isn’t valid according to HTML 4.01 spec, you actually are missing <tbody> tags either around your <tr> or <td> tags, I forget which. Also I’m not certain that the validator will “see” the finished page since its a runtime evaluation… have you tried using <%@ include %> directives?

    #220682 Reply

    Wim Goossens
    Member

    Riyad,

    I use XHTML but this specific html does validate as valid HTML 4.01 (strict and tansitional, for the <table>…</table> part)
    The use of <tbody> tags around <tr> tags is not needed.

    <jsp:directive.include is the xml equivalent of <%@ include directive jsp syntax
    In this case (xmain.jsp) the use of <%@ include directive is not allowed.

    I think this is a (small) bug. But because it is the ONLY (html/jsp) one,
    i thought it would be nice to have it fixed in the 3.8.3 release.
    This is also why i do not turn off the HTML validator. It seems to work nicely for me.

    Regards
    Wim

    #220688 Reply

    Riyad Kalla
    Member

    Wim, I duplicated this and will file it. Thank you for your patience.

    #220701 Reply

    Wim Goossens
    Member

    Riyad, Thank you and all the other people in the support team
    for their excellent work.

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: Invalid location of tag (td)

You must be logged in to post in the forum log in