SitePoint Sponsor |
|
User Tag List
Results 51 to 75 of 215
Thread: Use XHTML or HTML 4.01 Doctype?
-
Apr 9, 2005, 19:49 #51
- Join Date
- Mar 2005
- Location
- USA
- Posts
- 5,482
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It should be.
Code:<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
We miss you, Dan Schulz.
Learn CSS. | X/HTML Validator | CSS validator
Dynamic Site Solutions
Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.
-
Apr 9, 2005, 20:07 #52
- Join Date
- Apr 2004
- Location
- Melbourne
- Posts
- 362
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by BluDragon
-
Apr 10, 2005, 00:44 #53
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
The XML declaration must come first. But beware of using that indiscriminately if you're serving your pages as text/html. Anything, including an XML declaration, before the doctype declaration will make IE6/Win render the page in quirks mode.
Birnam wood is come to Dunsinane
-
Apr 10, 2005, 02:34 #54
- Join Date
- May 2004
- Location
- K.S.A
- Posts
- 81
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I have this in my so-called xhtml files:
Code:<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html dir="ltr" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
but after using:
PHP Code:header("Content-type: application/xhtml+xml");
and looking at the page info I found that the type is application/xhtml+xml..
I was happy
but knowing that IE wont parse it, I tried opening the same page with IE but it seems to render correctly!!
am I doing something wrong!?
edit: seems like it was a cache problem.. now any link I try to open with IE in that page will actually try to download..Last edited by NeverMind; Apr 11, 2005 at 15:31.
-
Apr 10, 2005, 07:14 #55
- Join Date
- Apr 2005
- Posts
- 19
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Okay. I changed the first lines of code on a static page to read:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
When I checked the header, it still tells me the content type is text/html. So the mime type must be the issue. I could set up the server to parse the static pages as PHP and add the header information, but if I just want to leave them as plain vanilla static pages, how do I change the mime type? Can this be done with the .htaccess file?
-
Apr 10, 2005, 09:41 #56
- Join Date
- Feb 2005
- Location
- from Madrid to Heaven
- Posts
- 8,271
- Mentioned
- 252 Post(s)
- Tagged
- 1 Thread(s)
Originally Posted by Tech Evangelist
Yes, you can change the mime type with the .htaccess file.
As far as my understanding goes, XHTML and XML applications do not render properly in browsers as these do not have full support for it (if any at all). Most of the XML applications that work do it because is it the web server that does the parsing, and not the browser. I think that Amazon Web Services works this way.
-
Apr 10, 2005, 11:15 #57
- Join Date
- Dec 2004
- Location
- Sweden
- Posts
- 2,670
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I could set up the server to parse the static pages as PHP and add the header information, but if I just want to leave them as plain vanilla static pages, how do I change the mime type? Can this be done with the .htaccess file?Code:AddType application/xhtml+xml xhtml xht
Simon Pieters
-
Apr 10, 2005, 13:53 #58
- Join Date
- Feb 2005
- Posts
- 581
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Tech Evangelist
-
Apr 11, 2005, 00:35 #59
- Join Date
- Jul 2004
- Location
- Juneau Alaska
- Posts
- 186
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Tommy, question for clarification:
Originally Posted by AutisticCuckoo
So same for HTML? Is that meta tag required for HTML or is it jst extra baggage. I have it in all my web pages that are not XHTML, but do not remember if it was something I was taught to use or just becauseall editors add it automatically, it has always simply been there.
So can we drop it from HTML as well as XHTML?
-
Apr 11, 2005, 00:41 #60
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I can't say for sure. The main reason for having the META element with a Content-Type equivalent is when you're saving the document to disk and opening it locally. Then there is no HTTP header being sent, and the META element can be useful, especially if you're using an odd character encoding.
This information should be sent from the web server, so there is no real need to have the META element.Birnam wood is come to Dunsinane
-
Apr 11, 2005, 00:46 #61
- Join Date
- Feb 2001
- Location
- Melbourne Australia
- Posts
- 6,282
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by LSW
Like with XHTML, and HTML user agent will check the character encoding specified by the HTTP Response header first. The user agent will only refer to a character encoding specified in a <meta> element if the character encoding was not specified in the HTTP response header.
It is safe, however, to leave the <meta> element in your document, if it contains correct information. It will simply be ignored when the character encoding is specified in the HTTP header. There isn't any significant reason why you should remove it.
You do need to specify the character encoding somewhere, however. You can't omit it completely. HTML user agents cannot assume any default character encoding - due to server limitations. This is why the <meta> element method is recommended when it is not possible to send the character encoding in the HTTP header.[mmj] My magic jigsaw
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Bit Depth Blog · Twitter · Contact me
Neon Javascript Framework · Jokes · Android stuff
-
Apr 11, 2005, 00:53 #62
-
Apr 11, 2005, 17:26 #63
- Join Date
- Mar 2005
- Location
- BC, Canada
- Posts
- 241
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by mmj
What exactly is not supported? I know it treats it as HTML, I understand that much. But XHTML and HTML 4.01 have the same syntax except for self-closing tags.
Does XHTML 1.0 actually have anything else which HTML 4.01 doesnt, but is not yet supported?
If it doesnt, then what in gawds name was the point of creating another language that gets parsed as XML instead by SGML ?
I feel like Im missing something here. Is there a whole world of cool XHTML tags that arnt yet supported, and I have not seen or ead about?
They arnt supported today, so I will serve them as HTML 4.01 but hell! I want to at least LEARN the new language so when it IS supported I will know what Im doing.
I been reading on some of the links posted in this thread and certain people refer to "real XHTML". What is "real" XHTML then other then HTML with self closing tags and a different doctype ?
I really just want to learn waht the differences are of "real" XHTML and HTML 4.01 because I find it interesting. Does anyone have any links for this? Are they actually the exact same?
I thought I had all this HTML/XHTML hooplah under control but now Im confused.... why cant we all just get along
-
Apr 11, 2005, 17:42 #64
- Join Date
- Mar 2005
- Location
- USA
- Posts
- 5,482
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It's true that there aren't many differences between HTML 4.01 and XHTML 1.0, however the differences that there are are quite significant.
real XHTML is XHTML served as XML, not as HTML.
XML is a simpler derivation of SGML, thus you can make smaller programs to handle XML and real XHTML documents.
Another point of XHTML is that it enables you to have HTML and XML elements in the same document.We miss you, Dan Schulz.
Learn CSS. | X/HTML Validator | CSS validator
Dynamic Site Solutions
Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.
-
Apr 11, 2005, 18:41 #65
- Join Date
- Mar 2005
- Location
- BC, Canada
- Posts
- 241
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
when "real" xhtml is served as such (application/xhtml+xml or whatever the correct syntax is exactly) what advantages does that give? How does the client and/or user benifit?
-
Apr 11, 2005, 20:15 #66
- Join Date
- Feb 2001
- Location
- Melbourne Australia
- Posts
- 6,282
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by dannyh
Code:<script type="text/javascript"> <!-- This is a script I wrote today --> <![CDATA[ alert('Hello World'); ]]> </script>
what in gawds name was the point of creating another language that gets parsed as XML instead by SGML ?
I feel like Im missing something here. Is there a whole world of cool XHTML tags that arnt yet supported, and I have not seen or ead about?
They arnt supported today, so I will serve them as HTML 4.01 but hell! I want to at least LEARN the new language so when it IS supported I will know what Im doing.
I been reading on some of the links posted in this thread and certain people refer to "real XHTML". What is "real" XHTML then other then HTML with self closing tags and a different doctype ?
I really just want to learn waht the differences are of "real" XHTML and HTML 4.01 because I find it interesting. Does anyone have any links for this? Are they actually the exact same?
http://www.w3.org/TR/xhtml1/
It's a pretty short document, so it won't take long to read. But if you want to skip to the good bits, read section 5.1 and then Appendix C.
I thought I had all this HTML/XHTML hooplah under control but now Im confused.... why cant we all just get along
This page debunks many myths about XHTML:
http://hsivonen.iki.fi/wannabe/
This page claims that interpreting XHTML as HTML is bad. But it is a bit of a rant, so don't get too disheartened:
http://www.hixie.ch/advocacy/xhtml[mmj] My magic jigsaw
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Bit Depth Blog · Twitter · Contact me
Neon Javascript Framework · Jokes · Android stuff
-
Apr 11, 2005, 20:37 #67
- Join Date
- Feb 2001
- Location
- Melbourne Australia
- Posts
- 6,282
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by dannyh
- XHTML can be combined with other languages in an XML document, by using multiple namespaces in the document. For instance, an XHTML+MathML document consists of both XHTML and MathML in the same document. This is impractical with SGML.
- Future versions of XHTML after XHTML 1.0 will not be compatible with HTML.
- XHTML can be processed by XML processors such as XSLT.
Those are some of the advantages. However, there are disadvantages too. One big disadvantage is the lack of support for XHTML in IE. Another is that legacy code, particularly a lot of JavaScript, will cease to work and fixing it will be difficult. In the latter case, you really should be using HTML 4.01.
Originally Posted by Kravvitz
[mmj] My magic jigsaw
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Bit Depth Blog · Twitter · Contact me
Neon Javascript Framework · Jokes · Android stuff
-
Apr 11, 2005, 21:44 #68
- Join Date
- Mar 2005
- Location
- USA
- Posts
- 5,482
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
From the point of view that, XHTML is XML-ized HTML, I meant what I said.
XHTML is just a standardized list of XML elements and attributes that happens to look a lot like HTML, right?We miss you, Dan Schulz.
Learn CSS. | X/HTML Validator | CSS validator
Dynamic Site Solutions
Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.
-
Apr 11, 2005, 23:02 #69
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Real XHTML, which IE does not support, allows style sheets to be specified through PIs (processing instructions) instead of LINK elements:
HTML Code:<?xml-stylesheet type="text/css" href="/default.css" media="screen"?> <?xml-stylesheet type="text/css" href="/special.css" media="screen" alternate="yes"?>
HTML Code:<script type="text/javascript" src="foo.js"/>
Birnam wood is come to Dunsinane
-
Apr 11, 2005, 23:10 #70
- Join Date
- Mar 2005
- Location
- BC, Canada
- Posts
- 241
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by mmj
Do I just need to learn plain old XML first then I will know what to do and I can write my own tags (Im assuming thats what it means by defining your own language) in the DTD ?
Right now at this current moment, does XHTML 1.1 have any addition tags that HTML 4.01 does not? If not, is it possible to create your own after reading up on the subject by creating your own DTD's?
Since XHTML is essentialy a more specific version of XML, if I versed myself on the XML language would I be able to 'play' with XHTML without learning additional material, or are they still seperated so I wouldnt neccessarily know what Im doing still?
The clouds are starting to clear a little for me on all this XHTML vs HTML stuff, especially when you throw in all the different versions of XHTML alone into the party.
-
Apr 11, 2005, 23:13 #71
- Join Date
- Mar 2005
- Location
- BC, Canada
- Posts
- 241
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
oh, and what about XSLT vs CSS?
Are either inferior, and will XHTML have a future with CSS or will it have its own stylsheet system (XSLT or otherwise) ?
-
Apr 12, 2005, 00:22 #72
The 2 will coexist, since one is used to markup html/xhtml and the other one is to style it all
-
Apr 12, 2005, 02:29 #73
- Join Date
- Apr 2002
- Location
- A Maze of Twisty Little Passages
- Posts
- 6,316
- Mentioned
- 60 Post(s)
- Tagged
- 0 Thread(s)
XSLT is generally used to transform markup and as for XHTML eXtensibilty that can be done via the DTD like I have done in the past. Also remember HTML will be predominantly used on most new websites for another decade whether we like it or not.
However, bear in mind all those browsers than don't understand "application/xhtml+xml" are less likely to be able to cope with the results of a modified XHTML DTD.
-
Apr 12, 2005, 05:24 #74
- Join Date
- Mar 2005
- Location
- BC, Canada
- Posts
- 241
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
This is strictly for testing xhtmlcoder... I just want to experiment
-
Apr 12, 2005, 17:16 #75
- Join Date
- Feb 2001
- Location
- Melbourne Australia
- Posts
- 6,282
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by dannyh
XSL-FO, however, is a stylesheet language. For a very vague and rough description of it, imagine CSS reformatted as XML. It's not time to throw out your CSS books though, as CSS is still a W3C recommendation and is still being developed (CSS3 is on the way).[mmj] My magic jigsaw
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Bit Depth Blog · Twitter · Contact me
Neon Javascript Framework · Jokes · Android stuff
Bookmarks