Getting VSD code to validate? - Post...

User 597929 Photo


Registered User
1,332 posts

I ran a couple of pages of my VSD-developed web site at the W3C validator:

http://www.spinland.biz

and

http://www.spinland.biz/links.html

I confess the results were not pretty. I read somewhere here (I think it was from Cary) that the doctype it uses has issues? Could that alone account for the bulk of the errors?

One other thing I noticed was that the validate tool didn't like the lack of an explicit character encoding clause in the links page. It's only on the home page because I added it manually to cover other issues. If this is supposed to be on every page oughtn't VSD include it?

I await comments and such from the more savvy among you. :cool:
"You can't be a real country unless you have a beer and an airline - it helps if you have some kind of a football team, or some nuclear weapons, but at the very least you need a beer." -- Frank Zappa

Visit Spinland Studios: http://www.spinland.biz
User 355448 Photo


Ambassador
3,144 posts

Spinny,

The important thing is does the site look good in all browsers. After that you can worry about validating all your code. Here are some of my rambling thoughts:

If the doctype is not exactly as provided at http://www.w3.org/QA/2002/04/valid-dtd-list.html then it will not validate. If you use HTML and close some tags (meta, hr, br) you may get errors in the validation that are not really errors.

Leaving the doctype off or not using the exact correct doctype will put browsers in quirks mode. Sometimes it is easier to get the page to display the way you want it to look if you force quirks mode.

Another way to not be able to validate is to use a specific program, knowing that it will not validate, but you still want that feature on your site. In that case, validating is just a way to locate errors in your code. When I am making changes to my site, I check the validation. I frequently find that I have failed to close a tag, or while editing I have cut and pasted everything I wanted to move as well as picking up a portion of a tag. As you can imagine, having an image tag that is only <im does not work so well, and the validator will catch things like that.

The CoffeeCup folks (here in the forums) are not overly concerned with validation, but some other forums will not provide any assistance until you validate your code.

Here I end my ramblings! :)
User 597929 Photo


Registered User
1,332 posts

Thanks, Bill. I need to look at the doctype setting in VSD, it's something I hadn't considered yet. Unless I hand-edit all the pages before publishing I'm limited to what VSD puts in there.
"You can't be a real country unless you have a beer and an airline - it helps if you have some kind of a football team, or some nuclear weapons, but at the very least you need a beer." -- Frank Zappa

Visit Spinland Studios: http://www.spinland.biz
User 597929 Photo


Registered User
1,332 posts

Ah, I see the problem. I think this is what Cary was getting at: for "HTML 4.01 Transitional" VSD uses all lower-case in the DTD declarations. These are case sensitive, I believe, and the correct ones have several upper-case characters so the VSD doctype is wrong and won't validate. That is probably causing the rest of the errors--or at least a chunk of them.

There are other errors that are as you say: some of the inserted code from other CC apps close out the tags with "/>" and W3C complains about that.

Unless CC fixes the doctype that VSD creates I guess the only real solution is to go in and hand-correct them to use the correct case.
"You can't be a real country unless you have a beer and an airline - it helps if you have some kind of a football team, or some nuclear weapons, but at the very least you need a beer." -- Frank Zappa

Visit Spinland Studios: http://www.spinland.biz
User 597929 Photo


Registered User
1,332 posts

Just had a weird thought. What happens if a web page has two doctype declarations, and the second one is valid? Does the browser freak out, or does it run with the last good one it sees?

I ask because a work-around for VSD might be to put a valid doctype declaration in the header section and then you wouldn't have to manually edit every page before you re-publish.
"You can't be a real country unless you have a beer and an airline - it helps if you have some kind of a football team, or some nuclear weapons, but at the very least you need a beer." -- Frank Zappa

Visit Spinland Studios: http://www.spinland.biz
User 463058 Photo


Ambassador
1,086 posts

The doctype issue is supposed to be fixed in VSD 6. As it is, it currently causes the validator to throw out a bunch of false negatives. I took a look at your main page, Spinny, and noticed the html code you inserted is surrounded my comment tags, but they are malformed. They start with this:

"<! --"

Notice the space that shouldn't be there.
User 597929 Photo


Registered User
1,332 posts

Huh. Something else to ask for in the next VSD release, you think? That stuff all gets auto-inserted.
"You can't be a real country unless you have a beer and an airline - it helps if you have some kind of a football team, or some nuclear weapons, but at the very least you need a beer." -- Frank Zappa

Visit Spinland Studios: http://www.spinland.biz
User 597929 Photo


Registered User
1,332 posts

I just checked a couple of other pages. It's got that space everywhere I inserted code into the header. Guess I'll bring that up for a future fix. Thanks for spotting that!
"You can't be a real country unless you have a beer and an airline - it helps if you have some kind of a football team, or some nuclear weapons, but at the very least you need a beer." -- Frank Zappa

Visit Spinland Studios: http://www.spinland.biz

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.