Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    •  
      CommentAuthorSpookyET
    • CommentTimeApr 9th 2006 edited
     permalink
    Yes, .htm, .html can be used to serve XHTML 1.1, but it's best to use .xhtml instead. This way, one can add filters to sniff IE and send it "ContentType text/html" instead of "ContentType application/xhtml+xml". Otherwise, you would send "ContentType application/xhtml+xml" on non XHTML documents to Firefox, Opera, et. al.

    This also applies to Server Side Includes. Keep .shtm, and .shtml for HTML and non-XHMTL 1.1 documents. Use .sxhtml for XHTML 1.1 documents.

    This is not complicated. All one has to do is to use .htaccess or CPanel to add a directive to the Apache configuration. The problem is some editors. Dreamweaver 8 will not highlight .sxhtml documents. No such problem in TopStyle or other editors that allow you to add file extensions easily.

    I have been modifying the MMDocumentTypeDeclarations.xml and MMDocumentTypes.xml in "C:\Program Files\Macromedia\Dreamweaver 8\Configuration\DocumentTypes", but it still will not work.

    PS: Dreamweaver also, by default, has a wrong template for XHTML 1.1. It misses the xml declaration and has the wrong ContentType of "text/html".

    Example: index.sxhtml (It's on a laptop, and so, it might turn off).

    Keen eyes will notice that it's not being sent as "application/xhtml+xml". I think that it might be a bug in the way Lighty handles SSI.

    This is what I have done to configure LIghty:

    mimetype.assign = (
    ".xhtml" => "application/xhtml+xml",
    ".sxhtml" => "application/xhtml+xml")

    $HTTP["useragent"] =~ "MSIE" {
    mimetype.assign = (
    ".xhtml" => "text/html",
    ".sxhtml" => "text/html")
    }

    ssi.extension = (".shtm", ".shtml", ".sxhtml")


    For non server-parsed files, it WORKS.
  1.  permalink
    You shouldn't be serving two different documents to different browsers. Read up some more on content negotiation...

    http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1

    Also, you can parse any extension as whatever you want.
    • CommentAuthorKanashii
    • CommentTimeApr 9th 2006
     permalink
    Indeed, you should be using content negotiation and you should also be using URIs without file extensions : )

    Another article to read: http://www.w3.org/QA/2006/02/content_negotiation.html
  2.  permalink
    And to note, there is more to XHTML than just self closing tags and quoting attributes. Using XHTML introduces a whole bunch of things you have to do...
    •  
      CommentAuthorSpookyET
    • CommentTimeApr 9th 2006
     permalink
    There are a few CSS issues, an DOM is totally different ( no shortcuts ). I'm not serving two different documents for different browsers. I'm serving the same document to different browsers, just different mime types.

    But, file extensions are useful, and by no means, those are not clean URLs.

    Content negotiation is exactly what I'm doing there.
    • CommentAuthorKanashii
    • CommentTimeApr 9th 2006
     permalink
    Also throw in some deflate/gzip and default charset : ) I haven't played around with Lighty yet, but I shall have a look soon.
    •  
      CommentAuthorSpookyET
    • CommentTimeApr 10th 2006
     permalink
    This post is about .SXHTML, not specific servers.
    That said, this works fine Apache.


    # Prevent viewing of .htaccess files

    order allow,deny
    deny from all


    # MIME types
    AddType "text/html; charset=utf-8" .xhtml .sxhtml

    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_ACCEPT} application\/xhtml\+xml
    RewriteCond %{HTTP_ACCEPT} !application\/xhtml\+xml\s*;\s*q=0
    RewriteCond %{THE_REQUEST} HTTP\/1\.1
    RewriteRule \.xhtml$|\.sxhtml$ - "[T=application/xhtml+xml; charset=UTF-8]"

    # SSI Handler
    AddHandler server-parsed .sxhtml
    Options Indexes FollowSymLinks Includes

    # Index pages
    DirectoryIndex index.php index.sxhtml index.shtml index.xhtml index.html index.htm
    •  
      CommentAuthorSpookyET
    • CommentTimeApr 10th 2006
     permalink
    It seems that there is no point in using XHTML 1.1 if one does not need to embed MathML or SVG. It's more pain than it is worth. XHTML 1.0 is debatable since it can be served as text/html. HTML 4.01 Strict? Everyone supports that.
  3.  permalink
    I'm not serving two different documents for different browsers. I'm serving the same document to different browsers, just different mime types.

    If you're serving two different MIME types, you are serving two different documents ;)
    •  
      CommentAuthorSpookyET
    • CommentTimeApr 10th 2006
     permalink
    I disagree.
  4.  permalink
    Create an HTML document. Leave the quote off one attribute value.
    Negotiate to send HTML 4.01 with text/html to one browser and then send XHTML 1.1 with application/xhtml+xml to another browser.

    You see two different documents, do you not?
    •  
      CommentAuthorSpookyET
    • CommentTimeApr 11th 2006 edited
     permalink
    No, I see two different parsing/rendering engines in action working on the same document. That's like Windows Media Player bitching that it can't render a .MOV file. The XML engine cannot parse invalid code. The change in MIME Type tells the browser which parsing/rendering engine to use.
Add your comments
    Username Password
  • Format comments as (Help)