Re: [xml] BUG: <table> tag ends paragraph

Date view Thread view Subject view Author view

From: Daniel Veillard (Daniel.Veillard@imag.fr)
Date: Wed Feb 21 2001 - 19:43:06 EST


On Wed, Feb 21, 2001 at 04:00:20PM +0100, Jonas Borgström wrote:
>
> Hi,
>
> I think I might have found a bug in the HTMLparser in gnome-xml.
> if you have some code like this:
>
> <.p>
> Some text
> <.table style="display: inline-table">
> ..some table rows....
> <./table>
> Some more text
> <./p>
>
> But when gnome-xml parses this file it will convert it to this:
>
> <.p>
> Some text
> <./p>
> <.table style="display: inline-table">
> ..some table rows....
> <./table>
> <.p>
> Some more text
> <./p>
>
> But this is not correct, because the "display: inline-table" tells the browser
> to put the table on the same line as the other text. But gnome-xml makes new paragraphs
> so it becomes impossible for the browser (gtkhtml2) to do this.
>
> after a quick look at the code in HTMLparser.c it looks like the line:
>
> "table", "p", "head", "h1", "h2", "h3", "h4", "h5", "h6", "pre",
>
> should be removed from the char *htmlStartClose[] initialisation.
>
> What do you think about this?

  Nothing, let's look at the spec:

http://www.w3.org/TR/html401/struct/text.html
9.3.1
<!ELEMENT P - O (%inline;)* -- paragraph -->

http://www.w3.org/TR/html401/sgml/dtd.html
<!ENTITY % inline "#PCDATA | %fontstyle; | %phrase; | %special; | %formctrl;">
<!ENTITY % fontstyle
          "TT | I | B | BIG | SMALL">

<!ENTITY % phrase "EM | STRONG | DFN | CODE |
                    SAMP | KBD | VAR | CITE | ABBR | ACRONYM" >

<!ENTITY % special
            "A | IMG | OBJECT | BR | SCRIPT | MAP | Q | SUB | SUP | SPAN | BDO">

<!ENTITY % formctrl "INPUT | SELECT | TEXTAREA | LABEL | BUTTON">

  So as far as I can tell, a table cannot be the child of a paragraph
I thing whoever accepts it as such is just making a non conformant
application, you guys believe in standards, right ;-)

  There might perfectly be mistakes in htmlStartClose, but in this
case it doesn't seems it's the case...

Daniel

-- 
Daniel Veillard      | Red Hat Network http://redhat.com/products/network/
veillard@redhat.com  | libxml Gnome XML toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
----
Message from the list xml@rpmfind.net
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rpmfind.net


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Feb 21 2001 - 20:43:46 EST