Forum Moderators: open
The link above might be useful to you but <?xml...> it is referred to only as an xml declaration.
Kaled.
If you are serving XHTML as pure xhtml/xml, then this is not a problem. (IE6 doesn't support that mode at all.)
As for what the XML line is, well it defines the version of the XML in use (1.0) and the encoding used.
The docuement is ultimately XML before it is HTML. Since XHTML is a subset of XML it's importance/ranking is second to XML. Therefore it would be proper to declare the document XML and then XHTML.
I prefer to have the encoding within the XML declartion in contast to having it in say a meta tag.
An XHTML document is exactly one particular flavor of the more general XML document standard.
Car is to Ford as XML is to XHTML (or HTML for that matter).
To go further:
Wheeled travel is to car as SGML is to XML.
But that's another discussion entirely.
I realize that XHTML is a sublevel of XML, but the only real similarity that I see between XML and XHTML is that they are both well-formed.
Think about it, people. XHTML is pretty much "well-formed HTML" and it is the W3C's attempt to make HTML well formed.
And I read some of these posts with people saying that XML is a replacement for HTML. At the moment it is not. XHTML is the awaited replacement for HTML. XHTML and HTML have similar DTDs in their namespaces as well.
Bruce
XHTML is, is, is XML.
Again, Car is to Ford as XML is to XHTML.
So, you could say "No, it's not a car! It's a Ford!"
Sure, but all Fords are cars. It's a car.
To be specific, XHTML is the XML standard which describes how to make XML documents that utilize tags from the HTML standard for formatting of text and media.
Please understand that an XML document can carry arbitrary tags. With this in mind, then an XML document whose tags all happen to be named things like "img", "strong", "li" and so forth is no different from any other.
Except for one thing: pump that bad-boy into a web browser and it dances. It's the browser that's special, or unique, since it knows how to parse XML documents whose tags are found in the HTML tag set, not the XTHML documents themselves.
I feel like I've beaten the dead horse, skinned it, butchered it, and taken it to market as loin steaks. Yet I still wonder if you see this clearly?
If you check W3Schools on the XHTML, it says that XHTML is:
XHTML stands for EXtensible HyperText Markup Language
XHTML is aimed to replace HTML
XHTML is almost identical to HTML 4.01
XHTML is a stricter and cleaner version of HTML
XHTML is HTML defined as an XML application
Are you going to argue with W3Schools and tell them that they are wrong? They are the most visited web site for web site technologies. I personally think that your car analogy is irrevelvant.
W3Schools also says that XHTML Is The Official HTML Standard. The same thing is mentioned on the W3C web site and nobody argues with W3C.
So, if you say I am wrong, then you are saying that W3schools and W3C is wrong.
All you have to do is pick up any book on the XHTML and it will say the same thing. I have put together over 100 XML documents for my clients and have taught classes in it.
Let's not argue over this. All you need to do is read any book on XHTML and go to the W3C site and search for XHTML and you will see that your Ford is a car analogy is nowhere to be found on either web site :)
Let's put it this way: XHTML and HTML have almost the same tags with XHTML using the strictness DTD over HTML. With XML you make your own tags and XHTML you do not.
:)
Dude, #*$!!?!?
That line of yours that I quoted, that line of yours that you claim refutes my point, that *is exactly* what I've been trying to tell you all along. That is, XHTML (or HTML itself) *is* XML.
What do you think "XHTML is HTML defined as an XML application" means?!?!?
I officially give up.
Personally, I have been using XML as XML and XHTML as HTML. So, I guess different people use it differently. I can see a lot of industry people arguing over this one. I got your point :)
XHTML is XML and both the W3 and some browsers agree to use those XML tags.
There is another standard besides XML which would be the XHTML subset. This is a secondary standard that W3 and browsers agree that certain XML tags (otherwise known as HTML) can be treated like HTML tags.
I think thats as simple as it can be put.
/////////////////////////////////////////////////////////
In regards to making a site in all XML (not XHTML) would that require setting up our own DTD? How would that work?
DTDs are optional. DTD's only serve to make your XML valid, but they will not help your XML documents look like nice looking web pages.
By the way, an XML schema is better than a DTD since schemas are XML as well.
Bruce
Take the Math ML doctype as an example. This extends XHTML to allow for equations and so on to be valid tags. You cannot do this with HTML - it cannot be extended. It has a fixed set of tags.
I do wonder if we should all be writing XML and parsing it to change the tags into HTML. (Eg: <paragraph> => <p>.) That approach would serve me well in the future (allowing for mobiles and other devices) but HTML is always more compact. (<li> instead of <list_item> etc).
At the moment, XHTML is a great way for HTML users to learn about XML.
In an effort to clean up HTML, XHTML was created as a markup language using the new XML specification. So, HTML is to SGML as XHTML is to XML. They are both defined markup impementations of their respective standard.
So to recap, HTML is defined according to the SGML standard and XHTML is defined according to the XML standard.