homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

This 73 message thread spans 3 pages: 73 ( [1] 2 3 > >     
XHTML -- is now the time?

 6:20 am on Mar 6, 2001 (gmt 0)

As of now, I haven't started writing strict HTML 4.0 , but I know that over a year ago, the W3C recommendation [w3.org] already moved on to XHTML 1.0.

So practically, what does this mean? From what I've learned so far it looks like the jump from transitional 4.0 to strict 4.0 is a much bigger jump than going from strict 4.0 to XHTML.

Would it make more sense to go straight to XHTML? Looks like it's just a matter of writing strict HTML 4 and adding on a small handful of extra rules. Things like closing every element, for instance -- writing <br></br> or <br /> instead of <br> seems a little odd, but it's no biggie. Well, maybe I'll need to update my editor first.

By the way, I found a very simple tutorial [w3schools.com]. I can use the W3C for looking things up, but I have a lot of trouble learning something new there.

So what is everyone doing, or planning to do? Strict XHTML requires CSS -- so external stylesheets seems to be the first order of business. From there, it seems a relatively simple jump to strict XHTML 1.0. Am I right?



 8:17 pm on Mar 6, 2001 (gmt 0)


I feel like I missed something. I was just going to make the leap from HTML to XML and use XSLT to make the web pages. I have had such bad luck with CSS stylesheets in the past that I really wanted a clean break.

Maybe I should look into XHTML. *shrug*



 10:08 pm on Mar 6, 2001 (gmt 0)

Even if you use XML/XSLT, you still need HTML/XHTML.

I do all my web pages using XHTML. It works great in virtually all browsers IF:

1) You make all tags lowercase

2) You enclose all attributes in double quote marks

3) Every tag must have a closing tag. Thus <input> must have </input>, <meta></meta>, etc. Particularly, <p> tags must have </p>. For a few HTML tags, there is no closing tag. For that use <br /> instead of <br>. The space before the / is required to keep all the current web browsers happy, although it is not required by XHTML specification.

4) A few attribute have no value. For example, multiple on a select tag. For those, you must use <... multiple="" ...>

5) Tags must nest properly. You cannot have <b><i>whatever</b></i> as the tags do not nest.

As long as you code to the HTML 3.2 spec, but use the above rules, virtually all browsers will be able to see and use the page.

I strongly recommend reading [w3.org...] for information on the what is different about XHTML. Particularly, read appendix C for how to make older browsers happy.
fixed typo

Edited by: Xoc


 10:49 pm on Mar 6, 2001 (gmt 0)

I guess it is good thing then that I have been anal about nesting/ form from the beginning. It drives me crazy if it isn't correct. I will have to get used to the double quotes and the closing tags for things like <br>



 11:32 pm on Mar 6, 2001 (gmt 0)

Isn't it true that visual tags like <font> must be moved to an external stylesheet? Or did I misread.


 1:34 am on Mar 7, 2001 (gmt 0)

There are three DTD (document type definitions) for XHTML (as there were for HTML 4.0). They are transitional, strict, and frameset. With the In transitional, the ugliest things about HTML are removed. In strict, everything about presentation has to be moved to a cascading style sheet. You must use frameset if you use frames.

Before the <html> tag, you place one of these three lines to indicate which set of tags and attributes you are using. A validator will use that to verify the rest of the document.

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"

I use transitional for everything, as there are a lot of browsers that can't do decent rendering if you use strict.

Edited by: Xoc


 1:41 am on Mar 7, 2001 (gmt 0)

Xoc, thanks for your input. It's good to hear from someone who is hands-on in any area, and you've moved me even closer to writing XHTML for new sites.

What is your opinion about converting old sites? Will there come a time when this is a must-do? What factors are at play?


 1:45 am on Mar 7, 2001 (gmt 0)

::cringing:: Just when I was getting comfortable.... *whimper*


 1:45 am on Mar 7, 2001 (gmt 0)

I don't think it is imperative to convert an old site, but it takes so little effort to code a new page in XHTML that I don't see why not to do it.

I should add to my comment above. The main problem with strict is that Netscape has so many bugs in its handling of CSS, that you practically can't use it. IE has less, but is also pretty apalling. The definitive list of CSS bugs can be found at [richinstyle.com...]

To see an example of pages coded in XHTML, see [w3.org...] (then view source) or look at my sites.


 5:29 pm on Mar 7, 2001 (gmt 0)

I usually do everything by hand, but I have learned that sometimes, it is faster to use a WYSIWYG editor.

Does XHTML have to be programmed "by hand", or are there authorware softwares to do it for you?



 12:45 pm on Mar 8, 2001 (gmt 0)

Dumb question, that I can probably dig out on my own, but what browsers support XML?


 8:19 pm on Mar 8, 2001 (gmt 0)

A great place for dependable information about XML is xml.com [xml.com]. This link goes to a detailed chart about which XML features are supported by major browsers.


 8:46 pm on Mar 8, 2001 (gmt 0)

I looked up the 4.01 specs on <font>. If your document is strict 4.01 <font> tags are not supported. If you use transitional, you can use <font> with the following attributes: class, color, dir, face, id, lang, size, style and title

I too am jumping on the XHTML bandwagon, very difficult to get my mindset away from years of preferentially coding in caps!


 11:19 pm on Mar 8, 2001 (gmt 0)

Unfortunately, browser makers are in the early stages of XML support...

IE 5.0 supports XML, but applying any sort of styling is a problem. The XSLT support won't work with any standard-compliant XSLT sheet, and CSS is just ignored. I don't believe it has any XHTML support at all, either. It will, of course, render the backward compatible subset of XHTML if you tell IE it's not XML. 5.5 is better (it supports standard XSLT).

NS 6.0 and Mozilla support XML with CSS and mostly get XHTML right. XSLT isn't turned on by default (and won't be until Mozilla 0.9 and Netscape 6.5 PR1, which should be released about the same time).

In short, I recommend sticking to the nearly-HTML 4.0-compatible subset of XHTML 1.0 and using the MIME type text/html and file extension .html (since IE gets confused about MIME types). Things should get better a couple of years down the road.


 6:06 am on Mar 25, 2001 (gmt 0)

IE 5 and 5.5 actually have some pretty decent support for client-side XML. But it is mainly Microsoft extensions to HTML. Things like Data Islands. I just taught an XML course in San Francisco last week that had a chapter on the Microsoft IE extensions. There are some really cool things. Like it will do paging for you, so you can show two records on a page and have next and previous buttons. IE does all the work. I can put together an example, if there is interest.


 5:26 pm on Mar 25, 2001 (gmt 0)

My concern is learning something that will work (someday) on all platforms..not just Microsoft.

Its like you are betting your career on who is going to win the race...and if you are wrong, you have to relearn everything...

What parts do you spend time learning and what parts can you "brush over"?



 6:49 pm on Mar 25, 2001 (gmt 0)

I'm not a big fan of things client-side for the Internet. However, most of us here are Internet developers. For an intranet developer, where you can control the web browser and environment it runs under, client-side is just fine. So if anyone is interested, I'll still put together an example.

None of that, of course, changes that XHTML is what you should code to today.


 10:51 am on Mar 26, 2001 (gmt 0)

I must confess, I'm spinning at this point trying to keep pace with changes and also do productive work at the same time.

Xoc, could you explain just a bit about the practical reasons for embedding data islands in an HTML page? I'm not sure how much I could get from a code example, until I understand the motivation for doing it.


 1:22 pm on Mar 27, 2001 (gmt 0)

Data Islands can come in two forms, internal and external. An internal data island will frequently be built from some server-side generated page. An external data island is frequently static.

The advantage of a data island is that it offloads data processing to the client. This reduces the load on the server, and can provide a more interactive experience. The main disadvantage of it is that it only works in IE. I don't recommend them for the Internet for that reason. But in places where you have a captive audience and can control the browser and browser version, such as B2B apps or intranet sites, they have some nice features. I'll provide an example as soon as I can work one up.


 6:41 pm on Aug 8, 2001 (gmt 0)

I read this discussion but I'm a little unclear on the advantages of changing to xhtml now. There are a lot of whats and hows but few whys. What's the imperative?

Seems it's mainly to adapt to a variety of future UA's and broaden the learning curve for xml and future versions of xhtml that might have more capability. Is this all?

BTW- Xoc, I'd be interested in the example you mentioned.

(edited for bad grammer)


 7:06 pm on Aug 8, 2001 (gmt 0)

1 good "why": To prevent having to update your pages when the next major browser updates come out.

Nothing seems to work right in NN6, because web designers weren't following standards (because previous browsers weren't either...). IE6 is causing some strange hiccups for the same reason.

Catch up to the up-and-coming standards on the new sites you're building now, and there won't be a need for a mad scramble to 'fix' anything when the browsers decide to get picky.


 7:24 pm on Aug 8, 2001 (gmt 0)

Thanks Mivox. Do you think browsers will be coming out that aren't backward-compatible with earlier standards?

Just to clarify the reason for asking, I'm writing up a proposal and need some convincing before advocating that others spend time and money.


 7:31 pm on Aug 8, 2001 (gmt 0)

Netscape 6 is not backwards compatible with a lot of current 'sloppy' coding... Opera is also intolerant of sloppy coding (and is gaining market share)... Give it a couple of years, and non-XHTML sites will probably start looking very strange in then-current browsers. Is it worth a little bit of extra time now, to prevent a massive cash outlay on overhauling your entire site from the guts outward in a year or two? I'd say, "yes."

And XHTML isn't really an extra expense. Follow HTML4 standards strictly (proper tag nesting is important: <p><a></a></p> ), make sure all your <tags> are lower case, and make sure everything has a closing tag: <p></p> (stand alone tags need to carry their own closing: <br />).

AFAIK, those three steps will make any otherwise HTML4 page compliant with the basic requirements of XHTML.

Anyone got any other details to add?


 9:21 pm on Aug 8, 2001 (gmt 0)

The one that's going to trip me up is enclosing all tag attribute values in double quotes. I've been letting my alphanumeric attributes stand naked in a lot of my coding.


 9:29 pm on Aug 8, 2001 (gmt 0)

enclosing all tag attribute values in double quotes
ah... bleaugh. That's one I've been terribly inconsistent with. :( I quote in most cases, but that just makes it more of a hassle if I have to go back and ferret out the occassional un-quoted attribute hidden away in a table somewhere.


 4:34 am on Aug 9, 2001 (gmt 0)

Okay, here is the data island example. I did it with an external data island. Remember, this only works in IE. The save the first file with a .htm extension.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<title>Data Island Example</title>
<xml id="xmlBooks" src="dataislanddata.xml"></xml>
<h1>Data Island Example</h1>
<form method="POST">
<table border="0">
<td align="right">Title:</td>
<td><input type="text" id="txtTitle" name="txtTitle" size="35" datasrc="#xmlBooks" datafld="title"></td>
<br />
<button onclick="xmlBooks.recordset.MoveFirst()" title="First Record" id="cmdFirst">Move First</button>
<button onclick="if (! xmlBooks.recordset.BOF) xmlBooks.recordset.MovePrevious()" title="Previous Record">Move Previous</button>
<button onclick="if (! xmlBooks.recordset.EOF) xmlBooks.recordset.MoveNext()" title="Next Record">Move Next</button>
<button onclick="xmlBooks.recordset.MoveLast()" title="Last Record">Move Last</button>

Save the second file as dataislanddata.xml in the same directory as the first file.

<?xml version="1.0"?>
<book bookid="1">
<title>Aboard the Galante</title>
<book bookid="2">
<title>Absent Minded Professor, The</title>
<book bookid="3">
<title>Ambercrombie Station</title>
<book bookid="4">
<title>Anome, The</title>
<book bookid="5">
<title>Araminta Station</title>
<book bookid="6">
<title>Asutra, The</title>
<book bookid="7">
<title>Augmented Agent, The</title>
<book bookid="8">
<title>Bagful of Dreams, The</title>
<book bookid="9">
<title>Big Planet</title>
<book bookid="10">
<title>Bird Isle</title>
<book bookid="11">
<title>Blue World, The</title>
<book bookid="12">
<title>Book of Dreams, The</title>
<book bookid="13">
<title>Caravan, The</title>
<book bookid="14">
<title>Chateau D'If</title>
<book bookid="15">
<title>Cholwell's Chickens</title>
<book bookid="16">
<book bookid="17">
<title>Commander Tynnott's Insufferable Redheaded Daughter</title>

Open the first file in IE, and watch what happens.


 6:25 am on Aug 9, 2001 (gmt 0)

Xoc, I opened the file in IE6. The screen renders fine, but I can't get any functionality. What is supposed to happen?


 2:04 pm on Aug 9, 2001 (gmt 0)

Thanks Xoc, a demo is worth a thousand words.

I don't suppose you'd know if Netscape plans to build in this capability for an upcoming release?


 9:24 pm on Aug 12, 2001 (gmt 0)

Tedster-I've only tried it in IE 5.5. What is supposed to happen is that you get to see one record at a time. The four buttons should allow you to navigate to the other records. Make sure that you have JavaScript turned on.

Bentler-I doubt it. This is a purely Microsoft extension.


 9:28 am on Aug 30, 2002 (gmt 0)

I have a question what does xhtml do and what are the benifits to implementing it into a site.

This 73 message thread spans 3 pages: 73 ( [1] 2 3 > >
Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved