Jump to content

XML question, HTML, XHTML


mbt

Recommended Posts

Hi,i made a website. Now i have to write a school report.I planned to say a few things about HTML, just some basic info,the "problem" however is that professor is saying i should talk about XML-it's a basic website, should i start learning XML and make a new website?Is XML better?What you suggest i do?I see many websites use XHTML, should i use that?I dont really understand the differences between them, i just need a stable basic website, validated.Regards

Link to comment
Share on other sites

Hi,i made a website. Now i have to write a school report.I planned to say a few things about HTML, just some basic info,the "problem" however is that professor is saying i should talk about XML-it's a basic website, should i start learning XML and make a new website?Is XML better?What you suggest i do?I see many websites use XHTML, should i use that?I dont really understand the differences between them, i just need a stable basic website, validated.Regards
I'm about to get off but I'll give you a quick explanation.XML is a way of marking up information to make it more accessible and categorized for humans to read and other applications. Any tag can be created. You could make a website out of it. But there would be no point.HTML is for creating web pages its the same as XML except it has predefined tags which a browser understands and translate.XHTML is strict HTML.Of you have already made a HTML website that should be enough.
Link to comment
Share on other sites

To add to what ApocalypeX said, XML is not a replacement for HTML. XHTML is.XML can be used in addition to or alongside (X)HTML, but not instead of.Using is in addition to is not easy, and in fact is useless for basic web sites.Using it alongside is described in detail within the XSLT tutorial. You can use XSLT to turn the XML into (X)HTML - within the browser, on the fly, with both the XML and XSLT (with (X)HTML in it) at hand.

Link to comment
Share on other sites

My understanding is that XHTML is a strict form of HTML and consists of HTML and XML mixed together.

Link to comment
Share on other sites

My understanding is that XHTML is a strict form of HTML and consists of HTML and XML mixed together.
XML is a set of rules for defining (and reading) languages.XHTML is a version of HTML that follows those rules. HTML itself doesn't follow XML rules, but SGML rules.SGML is a similar to XML set of rules, but more complicated, which is why XML was created on the first place - a simpler, easier to implement version of SGML. The "strictness" comes from the fact that the program reading XML is much simpler, and instead of trying to "stitch up" the document based on complex rules, it fails.
Link to comment
Share on other sites

The "strictness" comes from the fact that the program reading XML is much simpler, and instead of trying to "stitch up" the document based on complex rules, it fails.
Are you saying XML fails or SGML?
Link to comment
Share on other sites

The program reading the XML fails to read it, and just outputs an error.Programs that read SGML need to go over a complex set of rules to try and "stich up" the document before they fail and give an error.When I say "fail", I don't mean it in the FAILblog kind of fail. I mean it in the "opps... silly me" kind of fail.

Link to comment
Share on other sites

You could also say, in the "argh something's wrong can't do this halt" sort of way :). Note that if you have malformed XHTML but serve it with the text/html Internet media type, browsers will still try to patch it up as they would do to HTML. You need to send an application/xhtml+xml content-type header for true, uh, XML mode to be used.

Link to comment
Share on other sites

What is then the best type for a basic website, xml, xhtml, html?Does website or images on the website load faster if xhtml or xml is used,what about a website being vible in different browser the same way?

Link to comment
Share on other sites

XHTML and HTML are exactly the same when it comes to efficiency.XML is not for making websites, so you shouldn't bother with it if that's what you wanted from it. XML is a data storage format used to transfer information between different applications.

Link to comment
Share on other sites

Oh, so you're the "I must obey. I don't want to know why." type, huh?OK then... Use XHTML 1.0 Strict. But save files with ".html" extension. And be sure to use the W3C validator to check your code for errors.Synook already said the bad side of this, but the good was summarized by pretty much all other posts.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...