Bug report: LINK tag not well-formed in output

In testing my servlet which uses Tidy before doing XSLT processing, I've
been uploading copies of various HTML pages on the Internet.

This code:

<STYLE>
<LINK REL="stylesheet"
HREF="http://www.thestreet.com/tsc/common/stylesheets/global.css"
TYPE="text/css">
</STYLE>

Resulted in (XHTML mode):

<LINK REL="stylesheet"
HREF="http://www.thestreet.com/tsc/common/stylesheets/global.css"
TYPE="text/css">


Besides the fact that it's not XHTML (lower case), it's not well-formed, as
it should be an empty element.

I understand what the problem is here: <LINK> should be under <HEAD>, not
<STYLE>.  For my application, I don't particularly care if the XHTML output
is valid or not, but I definitely care if it's well-formed.

It would be nice if there was a way to incorporate, say, a SAX parser to
ensure the output is well-formed, and give the user options as to what to do
when it's not well-formed.  I would like a method returning true or false,
to let me know whether I should go on or not.

What exactly is the criterion for Tidy outputting something versus nothing?
In this case, <LINK> in its context, should be an unrecognized element...

Any further thoughts on this would be appreciated.

Thanks,

Evan Lenz
elenz@xyzfind.com
http://www.xyzfind.com
XYZFind Corp. "Building Better Search"

Received on Wednesday, 6 September 2000 13:57:52 UTC