TeamPhotoshop
Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
Forum Home Latest Posts Search Help Subscribe

what exactly is xml / xhtml ?

Page: 1 Reply
Oct 16th 2003#124954 Report
Member since: Mar 29th 2003
Posts: 1326
I've been doing a lot of surfing, etc. on CSS-based sites and they seem to use either XML or XHTML. Should I be coding in that? Do I have to change my doctype to do this? What benefits does it have? Are there any other tags or what?

Basically, I have no idea what it is. Can anyone help?

tom
Reply with Quote Reply
Oct 16th 2003#124956 Report
Member since: Nov 26th 2001
Posts: 2586
XML, very briefly, is a very strict syntax way of organizing your content using tags that you create. For example:
You could create an address document using tags that you need.
< address >
< name >Naam < /name >
< street >123 Lexus Lane < /street >
etc....
< /address >

It's not too complicated, but you have to read the rules on how to create XML documents in order to really understand how it works.

You do have to change your DOCTYPE in order to use XML, and there is no leeway with tags. If your page has a single error it will not display. You have to define your XML objects as well. Benefits: Any browser can read it. Wireless phones to your pc. Using XHTML you are putting HTML in a format that can be read in an XML way (sort of.). The benefit of this is portablility and you don't clutter the content with the design. Using css to display all of your attributes all of your html tags are bare, they all close, and a wireless browser can view them and ignore the design.

Deker knows more so he can elaborate or correct anything if I get something wrong.
Reply with Quote Reply
Oct 16th 2003#125003 Report
Member since: Mar 18th 2001
Posts: 6632
I don't know so much about raw XML and xHTML.

xHTML is basically just a more strict version of HTML. It is the "HTML of the future" to sum it up.

The good news is, it's basically identical to HTML.

If you set your doctype as xHTML transitional, then here are the major differences:

All tags have to be closed.

For instance, if you have a < p> tag, you have to have a < /p> before you can have another < p>. In old HTML it was actually ok to just have a < p> at the beginning of every paragraph. But now you have to close them all.

And if the tag doesnt' have a closing tag, like < img>, then you do it like this:

< img src="whatever.jpg" /> (notice the space+/ at the end)

Other examples:

< meta (stuff here) />
< br />
< hr />
Etc...

You also have to put all values in quotes:

< a href=yourpage.htm> <--- bad
< a href="yourpage.htm"> <--- good

And all of your tags have to be lower case:

< A HREF="something.htm"> <--- bad
< a href="something.htm"> <--- good

Those are the major differences. If you try to validate it as xHTML strict, then there are a couple more.

There are more differences between html and xhtml here as well: http://www.w3schools.com/xhtml/xhtml_html.asp

And of course if you write an xHTML page, you will want to validate it. Then you can see any errors that are in your page and repair them, to insure proper rendering in all devices.
Reply with Quote Reply
Page: 1 Back to top
Please login or register above to post in this forum