SitePoint Sponsor |
|
User Tag List
Results 26 to 35 of 35
-
Oct 12, 2009, 10:18 #26
-
Oct 12, 2009, 12:16 #27
- Join Date
- Sep 2005
- Location
- Sydney, NSW, Australia
- Posts
- 16,875
- Mentioned
- 25 Post(s)
- Tagged
- 1 Thread(s)
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">
-
Oct 13, 2009, 08:59 #28
-
Oct 13, 2009, 13:54 #29
- Join Date
- Mar 2008
- Posts
- 116
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Two handy references:
Activating Browser Modes with Doctype - Choosing a Doctype
Web-Sniffer HTTP Request & Response Header Viewer - can be employed to check how any Web Page is being served to various Graphical Browsers (specified via User Agent window).
James
-
Oct 13, 2009, 14:23 #30
- Join Date
- Sep 2005
- Location
- Sydney, NSW, Australia
- Posts
- 16,875
- Mentioned
- 25 Post(s)
- Tagged
- 1 Thread(s)
Theymay be useful references but neither of them has anything whatever to do with this topic since neither of them relate to the difference between HTML and XHTML. The first reference is about the doctype and the second about what HTTP protocol the page is using but neither covers the MIME type which is what determines whether a page is HTML (with MIME type text/html) or XHTML (with MIME type application/xml+xhtml).
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">
-
Oct 13, 2009, 14:39 #31
- Join Date
- Mar 2008
- Posts
- 116
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Oct 14, 2009, 01:21 #32
- Join Date
- Aug 2007
- Location
- Netherlands
- Posts
- 10,287
- Mentioned
- 51 Post(s)
- Tagged
- 2 Thread(s)
Off Topic:
imperious opining! : )
-
Oct 14, 2009, 04:09 #33
- Join Date
- Sep 2005
- Location
- Sydney, NSW, Australia
- Posts
- 16,875
- Mentioned
- 25 Post(s)
- Tagged
- 1 Thread(s)
The doctype has nothing to do with whether it is HTML or XHTML only whether the CSS should be treated as standard mode (if a valid doctype is present) or quirks mode (if no doctype or invalid doctype).
Examining the headers doesn't help any in actually setting the page to use the appropriate MIME type. So that web sniffer only touches peripherally on the topic.
Just because people sometimes go off the topic in a thread (in this one mostly due to misunderstanding what a web browser does with a doctype) doesn't mean that others shouldn't try to bring it back on topic.
Doctypes have nothing whatever to do with whether a web page is HTML or XHTML. You can use either a HTML or XHTML doctype to define your HTML page. You must use an XHTML doctype for an XHTML page but since both HTML and XHTML can use an XHTML doctype iit does not tell you anything about whether the page is HTML or XHTML.
To set up an XHTML page you need to do one of the following.
1. Set up your web server so that it has an extension defined for web pages that will insert the appropriate MIME type.
2. If you don't have access to the server config file then you can add an appropriate line to the .htaccess file (or equivalent for servers not using Apache).
3. You can use a server side language to insert the MIME type header in front of the page content (as I did with the example XHTML page that I posted earlier in the thread).
Iif you don't do any of those things then you are not usiing XHTML but are instead using HTML regardless of what doctype you use.
Trying to open the web page in Internet Explorer is a much easier way to check if the page is HTML (displayed) or XHTML (offered for download) than using any sort of sniffer that you can download or run from a web site since most people already have a copy of Internet Explorer (the ultimate XHTML sniffer) installed on their computer and they don't have to bookmark it to fiind iit again since it is easy to find on their computer whenever they need to check if a web page is HTML or XHTML.Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">
-
Oct 20, 2009, 14:43 #34
- Join Date
- Oct 2005
- Location
- Milton Keynes, UK
- Posts
- 996
- Mentioned
- 9 Post(s)
- Tagged
- 2 Thread(s)
The idea that serving HTML content as XML is pointless is incredibly short sighted
By allowing the document to be parsed as XML, it allows it to interact seamlessly with other XML technologies. For example. XSLT. It's incredibly useful to transform XML data into an XHTML document using XSLT (either server side or clientside) it allows for separation of content and presentation.
Whether or not end users web browser's can handle the XHTML page correctly is almost irrelevant, it's the fact that external web services can use your website with far greater ease because it's well formed, easy to parse and easy to load content from is where serving as XML really shines is.
The non-standardised error handling isnt a problem, because the only major browser which doesn't support XHTML is IE, which handles the errors in the way we want. Everything else can correctly parse the XHTML.
-
Oct 20, 2009, 23:39 #35
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Is it? People have been using pretend-XHTML since 1999 and it's still as pointless today as it was 10 years ago. And 10 years is a pretty long time on the web.
But it mustn't be parsed as XML if it's served as text/html! That says it's HTML and should be parsed as HTML or SGML.
Yes, (server-side) XSLT can be very useful. Keep your input data as XML and apply XSLT to transform it to a format that web browsers can handle.
So you use XSLT to transform the XML data into HTML. If, one day in the distant future, XHTML becomes a viable, well-supported option and you need to use elements from other XML namespaces, guess what: change <xsl:output method="html"/> into <xsl:output method="xml"/>, modify the doctype declaration and add the XHTML namespace to the <html> tag. And you're done.
In other words: using XSLT is no excuse for serving the result as pretend-XHTML. XSLT can serialise the DOM as HTML just as well as XML.
Again you are mistaken. If you serve the document as text/html it must not be parsed as XML. You may as well try to load it into PhotoShop and claim it's a JPEG image.
If you use XML+XSLT on your server, you can easily serve content as HTML to browsers and XML or XHTML to web services.Birnam wood is come to Dunsinane
Bookmarks