Welcome to WebmasterWorld Guest from 22.214.171.124
Forum Moderators: httpwebwitch
Would it be wise for me to learn xhtml or should I stick to html?
Is there an editor for xhtml so I can see how it is set up or should I get the book for dummies?
Does xhtml require any thing special as far a programs go?
they also have some good reading on xml. I would highly suggest learning and beginning a switch to xhtml. It is where the web is going. Better to learn it now. Most editors can handle xhtml. Like I said it isn't that much different. It's case sensitive, all attributes must be quoted and you need doc type declarations. Thats about it. It really is an easy step fron html to xhtml.
Basically, you write a document with tags -- and you can call the tags anything you like, as long as they are properly nested etc. So I might create an XML document to describe a book, and it would look like this:
<blurb>Being trained by the Assassin's Guild in Ankh-Morpork... (etc)</blurb>
As it stands, I have only described the structure. A browser like MSIE will display a heirarchical tree which can be collapsed, showing how everything is nested (or an error message if they aren't).
To make proper sense of it, I'd need a document type definition (DTD), which is where the <!doctype> declaration comes in, and a stylesheet. The DTD defines what tags are allowed, what attributes they may have, how they can be nested and so forth. The stylesheet defines how the different elements are to be rendered.
XHTML, basically, is an XML application that uses an XHTML DTD and stylesheet. (In practice, if you don't include the <!doctype> declaration, most browsers will assume you want an XHTML DTD.) It is one of many XML applications: some others include PGML (Precision Graphics Markup Language), VML (Vector Markup Language), CML (Chemical Markup Language) and so on.
There are some great places on the web to check out. Just do a google search for learning xml or xslt.
Like I said it isn't that much different. It's case sensitive, all attributes must be quoted and you need doc type declarations. Thats about it. It really is an easy step fron html to xhtml.
Well, there are a few more things that I can think of: all tags have to be closed with the appropiate closing tag; for instance if u have a <li> tag, in XHTML having a </li> is mandatory; on the other hand, in HTML 4.01 there are tags that have NO closing tag, like <BR>; in XHTML they have to be converted to "self-closed" tags, in this case <br />; yet another interesting thing is making <input>s validate as XHTML; suppose you have something like this:
<input type="Radio" name="subject" value="JOIN" checked>which is perfectly valid in HTML, but not valid in XHTML; in order to make it validate in XHTML, it will have to look like this:
<input type="Radio" name="subject" value="JOIN" checked="checked" />
I'm not sure I mentioned all "alterations" needed, but when migrating to XHTML, the W3C's validator [validator.w3.org] is a very handy tool to use, outlining every "mistake" you could have done. This along with the other very usefull links posted here should help you do the transition. Is it necessary? well, I'd rather think of it as a recommendation, but there will be a time when it will become a necessity.