PDA

View Full Version : Really weird XHTML validation problem


Grant Palin
02-02-2003, 06:57 AM
I'm converting my website to XHTML, constantly checking the pages with the W3C (X)HTML validator. The link below is for the result of validating one of my pages. To be specific, the validator is complaining about certain elements and attributes used in a tooltip hint script I got from DynamicDrive.com. What I want to know is, can this be changed so the (X)HTML validator will not complain? It works fine when I run it in the web browser. Or should I just not worry about it? Or should I remove it altogether (something I've been considering)?

http://validator.w3.org/check?uri=http%3A%2F%2Fwww.freewebs.com%2Fhommworld%2FHomm%2Fcreatures.html&charset=%28detect+automatically%29&doctype=%28detect+automatically%29&ss=1&outline=1&sp=1&noatt=1&No200=1&verbose=1

And here's the link to the actual page on my site, in case it matters.
http://www.freewebs.com/hommworld/Homm/creatures.html

Finally, here's the link to the page on DynamicDrive I got this from.
http://dynamicdrive.com/dynamicindex5/linkinfo.htm

Thanks for any input, opinions, etc

pardicity3
02-02-2003, 07:23 AM
I am pretty sure that your problem lies with the use of layer's and ilayer's in the script. The main reason people use layer's and ilayer's are for backward compatibilty with legacy NS browsers. Or atleast I am pretty sure on that. Anyway, I don't think that the <layer> and <ilayer> tag are included in HTML 4.01 so I would imagine your problems lies therein.

brothercake
02-02-2003, 02:15 PM
Yeah that is it; the bottom line is if you want XHTML validation, you have to take out all those layers ...

... but you can cheat. If you put the entire thing in a load of document.write and then put that in an external .js file, then it should validate :D

.. but it's probably better to abandon rich content for v4 browsers - my best advise would be to remove the script, and re-do that functionality in the DOM ...

Grant Palin
02-02-2003, 06:12 PM
Originally posted by brothercake
... but you can cheat. If you put the entire thing in a load of document.write and then put that in an external .js file, then it should validate :D

Phew! That sounds scary! I would have no idea how to do that, as I have very little knowledge of javascript.

...but it's probably better to abandon rich content for v4 browsers - my best advise would be to remove the script, and re-do that functionality in the DOM ...

I was thinking of removing the script altogether. But what do you mean by redoing the functionality in the DOM? What is the DOM?

cg9com
02-02-2003, 06:43 PM
document object model (http://www.w3schools.com/dom/default.asp)

Grant Palin
02-02-2003, 09:09 PM
I took a look at that, and I think it's a bit much for me right now. I was thinking of deleting the tooltip script anyway, so it's not a huge deal.

Tails
02-05-2003, 08:26 PM
I am trying to get validated too. But someone tell me, what's the difference from a Strict DTD, a transitional, etc. Someone tell me what a DTD is in the first place! I have no idea what they are, what they do, and they don't seem to be needed, do they? My sites function fine without them, no problems encountered. What's they're purpose? And if I have to use them, which do I choose?

brothercake
02-05-2003, 09:26 PM
The easiest way, I think, to understand what DTD is for, is to come at it from XML.

Try http://www.w3schools.com/dtd/default.asp

bluephoenix
02-07-2003, 02:45 AM
1. Line 130, column 32: there is no attribute "id" (explain...).

2. Line 130, column 43: there is no attribute "width" (explain...).

3. Line 130, column 56: there is no attribute "height" (explain...).
4. Line 130, column 73: there is no attribute "visibility" (explain...).

5. Line 130, column 79: element "ilayer" undefined (explain...).

Well, I think they changed ID to name, but I'm not sure. Anyone know more on that?

for the width/height/visibility, use inline styles to work around it (style="width: 200px; etc") That's what I did to my pages and it validates to XHTML strict.

Another option you could do is actually download and modify the DTD (that's coming with it from a XML perspective ;)). Add and define the iFrame element and add the other attributes to the tags where you need them. Of course you'd have to change your DOCTYPE to reference your new DTD...

hrm. part of me screams THAT'S A BLATENT ABUSE OF XHTML! but then the other part slaps the screamer around a bit and says, THAT'S WHAT THE DTD IS FOR!

meow
02-07-2003, 06:45 AM
Well, I think they changed ID to name, but I'm not sure. Anyone know more on that?

No. There is no attribute ID because the element layer doesn't exist so it can't have _any_ attributes. It's just the order the errors are listed. :p

bluephoenix
02-09-2003, 11:55 PM
ah, I gotcha . okay.

Tails
02-10-2003, 08:47 PM
Here's my main problem. I can look and learn all I want about DTD stuff. But I can't test it at home because the DTD doesn't do anything! It does nothing! But I want to things properly. My website http://XFox_Prower.tripod.com is a free place with banner junk. And the banners are inserted and fail hundreds of times per page in the validator. I want to download the validator for home, but the instructions on how to do that are so unclear! It makes no sense at all. Has to do with the w3's jigsaw server stuff and location, password (which I haven't gotten far enough to be asked for). I need help with that. I want the CSS, HTML, and XML, all I can get to use at home, where I have no internet.

meow
02-11-2003, 08:30 AM
:thumbsup: For (X)HTML I can really recommend Liam Quinn's ARV, if you can part with $25 (good for all coming upgrades). It's a Windows program, ho hassle. It's an offline version of the WDG validator. I've had it for years. It does custom DTDs, everything the online thing does.

http://www.arealvalidator.com/
http://www.htmlhelp.com/tools/validator/

It is A Real Validator, not a lint as all other offline programs. :p

Grant Palin
02-14-2003, 04:02 AM
I've been thinking about this, and I've decided that I'm not going to keep the script. I don't think it adds all that much to my site, and so it's not really needed. Besides, I tried the styling suggestions, and the validator rejected those too because the layer and ilayer elements don't exist in XHTML. Additionally, the DOM stuff looks a little much, and I don't want to bother with all that just to be able to keep using a fancy script. So, all that said, the script is gone. Thanks for all the input though.