develooper Front page | perl.libwww | Postings from April 2001

HTML::Tagset: p_closure_barriers

Thread Next
From:
Bjoern Hoehrmann
Date:
April 7, 2001 08:24
Subject:
HTML::Tagset: p_closure_barriers
Message ID:
bibuct4ciqvmu1u25jmuh8mskuf22hm1lh@4ax.com
Hi,

the HTML::Tagset manual defines the array
@HTML::Tagset::p_closure_barriers. I don't understand the rationale
behind this. The given example:

  <html>
    <head>
      <title>foo</title>
    </head>
    <body>
      <p>foo
        <table>
          <tr>
            <td>
               foo
               <p>bar
            </td>
          </tr>
        </table>
      </p>
    </body>
  </html>

_isn't_ legal. In SGML elements, that have optional end-tags are
implicitly closed, if an element, that could not be contained inside the
element (i.e. that is not part of the content model) occurs. Try to
validate the example at [1] and you'll get 

Line 17, character 8: 
    </p>
       ^Error: end tag for element P which is not open; try removing the
end tag or check for improper nesting of elements

The parse tree of the document is something like

  <html>
    <head>
      <title>
         foo
      </title>
    </head>
    <body>
      <p>
         foo
      </p>
      <table>
        <tbody>
          <tr>
            <td>
             foo
              <p>
               bar
              </p>
            </td>
          </tr>
        </tbody>
      </table>
      </p>
      ^^^^
   error, the element was already closed

    </body>
  </html>

[1] http://www.htmlhelp.com/tools/validator/direct.html
-- 
Björn Höhrmann ^ mailto:bjoern@hoehrmann.de ^ http://www.bjoernsworld.de
am Badedeich 7 ° Telefon: +49(0)4667/981028 ° http://bjoern.hoehrmann.de
25899 Dagebüll # PGP Pub. KeyID: 0xA4357E78 # http://learn.to/quote [!]e
            -- listen, learn, contribute -- David J. Marcus             

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About