Sam Cheung wrote:
 I have a very simple filter which print out all
 start/end elements. I find that the NOSCRIPT nodes
 does not close until it see a new NOSCRIPT node.

Your HTML file has this content:

<noscript><table><tr><td>
</noscript>

However, the HTML (4.01) DTD defines the following content
model for the <noscript> tag:

  <!ELEMENT NOSCRIPT - - (%flow;)*

Therefore, this kind of construct should not be allowed
in an HTML file. That being said, I notice that Mozilla
treats the content of <noscript> as CDATA which means
that all of the content is simple text. So what is the
"right" thing to do? Should NekoHTML follow the spec or
should it follow common practice?

It's very simple to change NekoHTML to make the content
of <noscript> be straight text. To do so, change line
317 of HTMLElements.java from:

ELEMENTS.addElement(new Element(NOSCRIPT, "NOSCRIPT", 0, new short[]{HEAD,BODY}, null));

to:

ELEMENTS.addElement(new Element(NOSCRIPT, "NOSCRIPT", Element.SPECIAL, new short[]{HEAD,BODY}, null));

and rebuild.

What are your thoughts on this?

--
Andy Clark * [EMAIL PROTECTED]


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



Reply via email to