Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why move from HTML to XHTML? Any benefits? 1

Status
Not open for further replies.

may1hem

Programmer
Jul 28, 2002
262
GB
I'm confused... Help! Why does everyone say that we should move to XHTML?

I search here for the benefits of XHTML:
...but the reasons seem to be that I'll be moving to a new technology and that I'll be complying with US accessibility laws.

That sounds ridiculous. My site is already friendly for accessibility, i don't live in the US, and is there any point to to upgrade just for the sake of it.

I even took the time to read some of O'Reilly's XHTML book and the author says that because there are billions of Web pages already written in HTML and it is unlikely that most of them will be upgraded to XHTML, so future browser versions will have to display these pages. And so continuing to write Web pages in HTML is just fine.

I read that search engines might be able to find information from XHTML pages more easily, but are they necessarily going to rank these pages higher, and if so then when?

Are there any credible reasons to upgrade to XHTML?

Thanks for your ideas,

May
 
I don't know much about XHTML so i'll just takea wild guess here, I think XHTML combines HTML and XML...XML is used to deliver dB-based content much faster... Forget the Nobel Peace prize, I just want to take over the world!! [hammer]
 
>> so future browser versions will have to display these
>> pages

That certainly seems very likely for the near future.

That does not take other issues into consideration, for instance:

1)Performance, parsing and rendering of XHTML will likely be faster than HTML.

2)Support of "new/future" features available only when your document is valid XHTML.

Does this mean you should convert your existing code, perhaps not. Each project should be considered individually based on it's requirements/restrictions etc.

Does this mean that new development should be XHTML, probably so.

-pete
 
mayhem,

XHTML will be ranked higher eventually. HTML will be dropped from the planet and XHTML will be the favored markup language on the web.

The reason why XHTML is so good is that it is (mostly) rendered easily with older browsers.

Newer browsers have faster parsers to go through XHTML than HTML (it was designed with improvements in mind). This means that a page in fully compliant XHTML will be on the person's screen faster. Also eventually all browsers will only support XHTML so if you want to do less work you may as well write everything in XHTML so you don't have to convert them later. Gary Haran
 
Some comments:

XHTML is not a combination of HTML and XML, it is HTML structured using the less forgiving XML standard.
Just to be clear, XML is not a language.

XML is used to encapsualte data in a very regular fashion. Ie there is an element, it has a beginning and end tag and can contain text and more elements. Thats it. It is not a replacement for databases as many people think, just a way to describe data in an esay to parse and standardized way. That way you can have your program output data in XML with a set of standardized (either world-wide accepted or internally accepted) formats and tagnames and someone else can very easily create a module that will import that data into their own program.

XHTML is HTML that is well formatted. All tags have end tags, not tag blocks overlap each other, etc. You could say it is the strict version of HTML without the laziness that browsers will forgive, like forgetting end tags and so on.

One good reason to use XHTML is that many new devices (such as cel phones) have portals that can render XHTML pages into something viewable by the phone. More people is good.

It can also be parsed easier by programs, there are programs out there that will index your site, some of them work much better if you are using XHTML because they don't have to guess as much when you have sloppy html.

And on and on. Basically XHTML is just a stricter version of HTML, there is no reason why anyopne shouldn't be using it these days, except that it is new and not everyone knows what it is yet and, of course, laziness. In all honesty it is not really any more difficult than writing in HTML, and still much easier than SGML :p

-Tarwn [sub]01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101 [/sub]
[sup]29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19[/sup]
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 
Close,
You need to add a doctype declaration to the first line, and generally you should have the xml namespace defined in the html tag, but this is not strictly necessary as it will be added by the browser processing it.

w3schools has a good set of tutorials on the differences and so on, you can also read the latest XHTML recomendation from the W3C here:
-Tarwn [sub]01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101 [/sub]
[sup]29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19[/sup]
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 
Cheers Tarwn

Having just completed two WAP sites I've got used to the stricter markup spec anyway. Iam curently at the early stages of a ground up re-build on an existing site which has been on the web for about 5-6 years in it's current form.
I may as well go the extra mile and make it XHTML compliant.
Regards
Ian Infinity exists! - I just haven't worked out a way to get there yet.

| |
 
Heh, I need to go back through my site and finish making it compliant, I've spent enough time now with XML that I almost develop in XHTML anyways. Lowercase tags, quotes around attributes, no overlapping elemts, etc. are almost second nature now. All I have to do is stop writing
Code:
<br>
tags without an end slash :p It's amazin how hard a 10 year habit is to break when your trying to get things done :)

-Tarwn [sub]01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101 [/sub]
[sup]29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19[/sup]
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 
The thing is, I'm just starting to put together the content for my site and I'm going to use a content management tool which takes advantage of the WYSIWYG features of MSHTML.

My understanding is that this will only output HTML.

I really need a WYSIWYG method of inputting articles. Any ideas? (btw, I'm using ASP).

Thanks,

May
 
Currently Gecko browsers (Mozilla, Phoenix, Netscape 7) give us a snapshot of the future of XHTML. If you feed Mozilla a valid, well formed XHTML document and pass it a mime type of text/html it will use a parsing mode called &quot;tag soup&quot;. This parsing mode assumes the markup is badly structured (hence tag soup) and goes through many algorithms to make sure and handle whatever coding mistakes are made. All browsers do this and it's inefficient.

If you pass Mozilla a mime type of application/xml it uses the built in XML parser rather than tag soup. Stricter, but way more efficient. MSIE doesn't do this yet, but look for it in the future.

XHTML leads us to a web that is faster, more lightweight, and with better coding structure. BTW- Look for some very cool innovations with XHTML 2, such as the disappearance of the <a> tag, replaced by putting the href=&quot;&quot; attribute in any tag you want, such as <li href=&quot;foo&quot;>foo</li>.

petey
 
Thanks Petey,

Has anyone measured the increase in speed of XHTML over HTML? That would be interesting to see if the performance benefit is enough to justify the extra work involved.

BTW, if it helps anyone else, there is a project on Sourceforge called Tidy (HTMLTidy and JTidy) which checks & converts HTML to XHTML.

I'd rather have a form which allowed users to create XHTML using a WYSIWYG interface but I can't find a free one that will work by Javascript. If anyone spots one then please let me know.

Thanks,

May
 
Yeah, i tried Tidy a few months ago and it did not work. There were a couple others i found that also did not work. I mean they work for some HTML but not all of the stuff i need to throw at it.

-pete
 
HTML-Kit by chami.com uses Tidy as it's main program for cleaning and checking code and I think it's excellent.
I check and convert (to xhtml) all my pages before using the w3c validator.


É ::
 
&quot;Having just completed two WAP sites I've got used to the stricter markup spec anyway. Iam curently at the early stages of a ground up re-build on an existing site which has been on the web for about 5-6 years in it's current form.
I may as well go the extra mile and make it XHTML compliant.
Regards
Ian&quot;

ne4x4, where did you go for learning WAP? I have made a simple site for my phone that allows me to get to AIM, Yahoo..etc, just some main links. I want to have them all as options so I can push numbers to access them, but I couldn't figure out how to jump from an option to the corresponding link.

When I push an option, the link is added onto the current location of the file. (If the main page is at and the option has a link to the result of clicking on the option is
I'm probably not making sense, but I was just curious over this topic and thought I'de mention something. Right now I have to point each option to a seperate wml page, and each wml page redirects me to the correct link. This adds an extra page of loading in between the options.

Anyways, if you can elaborate on what I could do to fix this or point me in a direction where I can find help that'de be awesome. Otherwise I'll just stick with my extra loading page, it's no big deal.

Lance
 
Lance check out the following tek-tips forums

forum658
forum729

Automatically Dial a phone Number


WAP Development Software


WAP Documentation


Hope this helps
Regards
IAn


Infinity exists! - I just haven't worked out a way to get there yet.

| |
 
Guys after reading this thread I got very interseted, so I read thru alot of stuff and I plan on writing stricter code to become xhtml compliant. If one of you guys could take the time to explain these things to me it would be greatly appreciated. I read there explinations, but was not very clear.

1) Line 8, column 52: required attribute &quot;TYPE&quot; not specified (explain...).
<SCRIPT LANGUAGE=&quot;JAVASCRIPT&quot; SRC=&quot;java/rollover.js&quot;></SCRIPT>
^
2) Line 9, column 48: required attribute &quot;TYPE&quot; not specified (explain...).
<SCRIPT LANGUAGE=&quot;JAVASCRIPT&quot; SRC=&quot;java/date.js&quot;></SCRIPT>
^
3) Line 12, column 17: there is no attribute &quot;LEFTMARGIN&quot; (explain...).
<body leftmargin=&quot;0&quot; topmargin=&quot;0&quot; rightmargin=&quot;0&quot; bottommargin=&quot;0&quot; marginwidth=
^
4) Line 12, column 31: there is no attribute &quot;TOPMARGIN&quot; (explain...).
<body leftmargin=&quot;0&quot; topmargin=&quot;0&quot; rightmargin=&quot;0&quot; bottommargin=&quot;0&quot; marginwidth=
^
5) Line 12, column 47: there is no attribute &quot;RIGHTMARGIN&quot; (explain...).
...margin=&quot;0&quot; topmargin=&quot;0&quot; rightmargin=&quot;0&quot; bottommargin=&quot;0&quot; marginwidth=&quot;0&quot; mar
^
6) Line 12, column 64: there is no attribute &quot;BOTTOMMARGIN&quot; (explain...).
...gin=&quot;0&quot; rightmargin=&quot;0&quot; bottommargin=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; tex
^
7) Line 12, column 80: there is no attribute &quot;MARGINWIDTH&quot; (explain...).
...gin=&quot;0&quot; bottommargin=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; text=&quot;666666&quot;>
^
8) Line 12, column 97: there is no attribute &quot;MARGINHEIGHT&quot; (explain...).
...gin=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; text=&quot;666666&quot;>
^
9) Line 18, column 67: required attribute &quot;ALT&quot; not specified (explain...).
...g src=&quot;images/header.jpg&quot; width=&quot;750&quot; height=&quot;151&quot;></td>
^
10) Line 23, column 70: there is no attribute &quot;HEIGHT&quot; (explain...).
...der=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; height=&quot;1&quot;>
^
11) Line 32, column 34: there is no attribute &quot;HEIGHT&quot; (explain...).
<tr align=&quot;center&quot; height=&quot;15&quot; width=&quot;750&quot;>
^
12) Line 32, column 45: there is no attribute &quot;WIDTH&quot; (explain...).
<tr align=&quot;center&quot; height=&quot;15&quot; width=&quot;750&quot;>
^
13) Line 63, column 81: required attribute &quot;ALT&quot; not specified (explain...).
..._welcome.gif&quot; width=&quot;750&quot; height=&quot;20&quot;></td>
^
14) Line 108, column 49: required attribute &quot;TYPE&quot; not specified (explain...).
<SCRIPT LANGUAGE=&quot;JAVASCRIPT&quot;>gettheDate();</SCRIPT>
^
15) Line 112, column 104: required attribute &quot;ALT&quot; not specified (explain...).
...ad_quote.gif&quot; width=&quot;180&quot; height=&quot;19&quot;></td>
^
16) Line 120, column 108: required attribute &quot;ALT&quot; not specified (explain...).
...mergency.gif&quot; width=&quot;180&quot; height=&quot;19&quot;></td>
^
17) Line 128, column 103: required attribute &quot;ALT&quot; not specified (explain...).
...ead_news.gif&quot; width=&quot;180&quot; height=&quot;19&quot;></td>
^
18) Line 136, column 105: required attribute &quot;ALT&quot; not specified (explain...).
...d_recent.gif&quot; width=&quot;180&quot; height=&quot;19&quot;></td>
^
19) Line 141, column 8: document type does not allow element &quot;BR&quot; here; missing one of &quot;TH&quot;, &quot;TD&quot; start-tag
<br>
^
20) Line 164, column 82: required attribute &quot;ALT&quot; not specified (explain...).
...ef=&quot;index.html&quot; onFocus=&quot;this.blur()&quot;>
^

I understand the alt tag ones, but the others are a little confusing. Not even a year solid with html yet, so please forgive my ignorance.

Thanks for your time.

csatterwhite@orlandomediasolutions.com
 
1) Line 8, column 52: required attribute &quot;TYPE&quot; not specified (explain...).
<SCRIPT LANGUAGE=&quot;JAVASCRIPT&quot; SRC=&quot;java/rollover.js&quot;></script>

you should replace language=&quot;javascript&quot; with type=&quot;text/javascript&quot;

3) Line 12, column 17: there is no attribute &quot;LEFTMARGIN&quot; (explain...).
<body leftmargin=&quot;0&quot; topmargin=&quot;0&quot; rightmargin=&quot;0&quot; bottommargin=&quot;0&quot; marginwidth=

use <body style=&quot;margin:0px;padding:0px;&quot;> instead of marginwidth, marginheight, etc.

10) Line 23, column 70: there is no attribute &quot;HEIGHT&quot; (explain...).
...der=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; height=&quot;1&quot;>

instead of padding your layout with sized table cells, <br> tags, or transparent pixels, you should use CSS padding, margin, width, and height styles to get the necessary spacing.

Hope this helps

petey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top