Re: Safari inadequate?



In article <slrnh1fvg6.arc.foo@xxxxxxxxxxxxxxx>,
Ian Gregory <foo@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:

On 2009-05-23, Sander Tekelenburg <user@xxxxxxxxxxxxxx> wrote:
In article
<NOwebmasterSPAM-63BE18.07092723052009@xxxxxxxxxxxxxxxxxxxxx>,
Eric Lindsay <NOwebmasterSPAM@xxxxxxxxxxxxxxx> wrote:

Using the .xhtml extension is handy, because then local copies of your
file (on a Macintosh) will be treated as XHTML. Safari, Opera and
Firefox will all use their XHTML parser, not their HTML parser.

Really? I haven't tested, but I'd expect doctype switching to be applied
to local files too. And then there is the <meta
http-equiv="content-type"> mess...

When I introduce a tag mismatch error into one of my local .xhtml files
Safari throws an error and only renders the page up to the mismatch (as
expected). If I then simply change the extension to .html there are no
errors and it appears to render fine (though of course due to the tag
mismatch it is no longer valid).

Clearly Safari is basing its choice of parser on the file name
extension. The original file in question is valid XHTML Basic 1.1.

I just tried adding the following line to the head section:

<meta http-equiv="Content-Type" content="application/xhtml+xml" />

Safari still uses the HTML parser - presumably the .html file extension
is overriding the meta tag.

I think the Content-Type meta should be ignored, and that the Apple file
system is doing it correctly.

If coming from a web server, the web server gets final say, so you do
not need the meta.

If coming from a local source, the file system needs to decide the type
of file. Unless it is looking inside the file for file creator details
or the meta tag, it will be using file system metadata or an extension.

I seem to recall seeing W3C material to the effect that the meta
content-type tag was not a good idea for .xhtml. So I mostly leave it
off these days for .xhtml (although not for .html). Not sure I am
correct in doing that, but if challenged, I think I could come up with
reasonable arguments for doing it my way.

--
http://www.ericlindsay.com
.



Relevant Pages

  • Re: Safari inadequate?
    ... Firefox will all use their XHTML parser, ... Safari throws an error and only renders the page up to the mismatch (as ... If I then simply change the extension to .html there are no ...
    (comp.sys.mac.system)
  • Re: Some browsers dont "see" the .jpg files
    ... I have written a simple website using XHTML 1.0 compliant code. ... Why is it that Safari on a Macintosh presents the images: ... Have I gone too far modern into XHTML for most browsers? ... jpg then they don't work in some browsers. ...
    (uk.net.web.authoring)
  • Re: .txt extension added during download
    ... You mentioned Safari, so I'm guessing you use an http:// ... and I use "save the target file" to save the file on my hard disk. ... I've never heard of curl tagging on an arbitrary extension (at ... "download manager" dialog box. ...
    (comp.sys.mac.apps)
  • Re: URL validation
    ... served as XHTML, ... is served as text/html. ... What extension? ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: I really do like OS X but . . .
    ... When I download that file with Safari and strip ... And it isn't something with Safari - the exact same thing ... I use the Get Info panel to remove the extension. ... "I use Avast AV, the Yahoo anti-spy toolbar, the MS anti-spy software, ...
    (comp.sys.mac.advocacy)