Re: still too early for XHTML :-((
Jacob Kjome <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.xmlc |
|---|---|
| Message-ID | <[email protected]> |
The correct content-type for XHTML is "application/xhtml+xml;
charset=UTF-8". I always put the following in my XHTML pages...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml;
charset=UTF-8" />
<meta http-equiv="Content-Script-Type"
content="application/x-javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />
The one exception to the above is that, even though I specify
"application/x-javascript" above, I put the following in my <script> tags
for IE compatibility..
<script type="text/javascript">
And, like I said in a previous message, <script></scipt> is the syntax
understood by most browsers and, I think it is for good reason. I believe
that the HTML4 spec defines it this way and I don't think that the move to
XHTML made this an, optionally, empty tag. The fact that Mozilla
understands <script /> does not necessarily mean IE is buggy in not
understanding it (just a bit more stupid). Actually, IE really doesn't
understand XHTML anyway. In fact, the way any XML is treated by IE is to
transform it, internally, into standard HTML for display by the HTML layout
engine. Yep, IE really doesn't directly support XML, let alone XHTML
whereas Mozilla does.
So, can anyone confirm that if an XHTMLScriptElement is added to the XHTML
DOM that it is written as <script></script> instead of <script />? If it
is writing it as <script /> then we will have a major browser
incompatibility. It should definitely be written as <script></script>.
Jake
At 12:20 PM 4/7/2003 -0400, you wrote:
>We've been using XHTML+XMLC for 9 months, and we too encountered that
>problem. My solution, was to do it this way:
><script src="x"><!-- IE Sucks --></script>
>
>every place we want to use a "self-terminating script tag".
>
>Having said that, I'm also curious as to what the document type you're
>sending down in your request headers. Even though we produce XHTML, we're
>really telling it we are an html document. It's quite possible that
>sending the correct "Content-type" header down will work. Problem is, I
>don't know what the correct type REALLY is.
>
> > Hi,
> >
> > as you may recall from my occassional posts here, I have been trying to
> > use XHTML with Enhydra for several months already. I patched various
> > things in Enhydra/XMLC (some fixes, some hacks) in order to get it
> > working and was almost happy - until I decided to try also non-Gecko
> > browsers. After some hours of debugging IE6 problems I managed to
> > isolate a possible bug in SCRIPT tag handling:
> >
> > http://www.prevue.cz/ie6bug.html
> >
> > For me it seems as a clear evidence that I wasted my time on the XHTML
> > for nothing. If the latest browser with 95% market share is unable to
> > load javascript file then XHTML is completely unusable.
> >
> > I don't think XMLC/Enhydra would be modified in the way it outputs the
> > SCRIPT tag just to fix this buggy behaviour of IE. Or am I wrong and
> > such patch would be accepted in the mainline?
> >
> > Anyway, I'll most probably convert my XHTML files to HTML, change the
> > XMLC parser back to the default one and be happy again.
> >
> > Petr
> >
> >
> > _______________________________________________
> > XMLC mailing list
> > [email protected]
> > http://www.enhydra.org/mailman/listinfo.cgi/xmlc
>
>
>
>_______________________________________________
>XMLC mailing list
>[email protected]
>http://www.enhydra.org/mailman/listinfo.cgi/xmlc