Forum Moderators: coopster & phranque

Message Too Old, No Replies

Validating script output

'save as' and run tidy?

         

dingman

12:25 am on Sep 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Typically, I write dynamic sites using query strings for all the input, and validate output by checking URLs from validator.w3.org. However, with some forms it just doesn't make sense to put all the data in the query string.

For example, I have a site with a message posting form, and given the limitations on query string length with some browsers and servers, submitting the body of the form via "get" makes no sense. I know that the post confirmation page renders just fine, but not that all the tags have their apropriate end tags, etc. If I try to validate the page to make sure, what the validator sees isn't the result of posting, it's an error message. It's nice to know that the error message is XHTML 1.1 Strict, but I'd like to know the same thing about the post confirmation message, too.

The only solution that occurs to me is to save the output and then run a validator on the file. I'd really like something as convenient as clicking a link at the bottom of the page. Does anyone else have more convenient solutions for this?

bobriggs

12:34 am on Sep 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not really sure what you're getting at here dingman. Are you saying that you're submitting the equivalent of your POST in a query string to the validator, and that you're getting errors or different results?

Ok, I reread, you're not inputting everything into the query string.

The way I validate this stuff is to do the post in Opera, then right click and select Frame¦Validate Source. This takes a copy of the result POST, saving it in a temp file, and uploads it to the validator. Probably a lot easier than what you're trying to do, if I understand correctly.

dingman

1:36 am on Sep 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks, Bobriggs. I didn't know Opera did that. (I usually don't look at things in Opera until I'm fairly near the end of the project, just to make sure they don't look ugly.) It sounds like just what I'm looking for.

<added>And using it now, it seven acts like just what I'm looking for, too. I wonder if any of the modern open-source browsers do that? [pokes at Galeon]</added>

bobriggs

1:59 am on Sep 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I didn't know Opera did that.

Took me a while to find it too. Really makes a BIG difference. I used to validate stuff here and there, but with Opera giving you a right-click menu option, I validate everything now.

Before I had to find the bookmark, (out of thousands it took at least a while), then browse to the page or copy and paste the url. (I didn't like doing that because it was a hit on my server and didn't want to count it). Or if it was on my computer I'd have to browse to the file. I think this is one of the great features of Opera, and I do think it will make at least a slight difference in the number of sites that validate correctly.

dingman

3:39 am on Sep 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I had to find the bookmark

For almost as long as I've been doing server-side scripting, I've put a link to [validator.w3.org ] on the bottom of every page to deal with that. It only works, of course, in places where the machine I am developing on has a real-world IP and hostname. Luckily, that's the norm for university computers, and two of the three employers I've done this for have been colleges. It also means you have to be editing the page on a server you aren't trying to get meaningful hit-counts from, but even with the Opera method you generate one hit for each page you validate. (Which, I suppose, is less distortion than twice as many hits.)

(For clarity, only one of those three is a post-graduation employer, and in all honesty I do more advanced server-side stuff as a hobby than I have ever had call for at work, though the law office came close.)

bobriggs

3:52 am on Sep 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



right, exactly. I forgot that I did have to get to the page itself and generate a hit for myself. But that is filtered in my stats. The validator IP is something else, and others sometimes do validate the page (which I like to see!) So I don't block the IP from the w3 validator page.

Really not too big a deal, not many really validate the pages. Call me A**L.

But I really do think its (in Opera) a great feature, and you don't need to include the w3.org link on every page.

There is a lot of talk about validation on WebmasterWorld, and it seems to be growing- a good sign. ;) No telling how many simple layout problems would be solved if everyone tried validation.

dingman

6:25 am on Sep 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No telling how many simple layout problems would be solved if everyone tried validation.

Indeed. It's a wonderful way to catch one's silly mistakes and places where you cut-and-paste a line off. I find it all the more useful for dynamicaly generated pages. It should do wonders for interoperability, too, although DOM issues in various browsers will still be an issue for client-side programing.

Josk

9:30 am on Sep 16, 2002 (gmt 0)

10+ Year Member



Why not use htmlTidy and validate locally?

andreasfriedrich

10:04 am on Sep 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Why not use htmlTidy and validate locally?

Because htmlTidy is not a validator.

Josk

10:10 am on Sep 16, 2002 (gmt 0)

10+ Year Member



Fair point -- and useful as its something I need to look into...

andreasfriedrich

10:30 am on Sep 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



On rereading your previous post there is nothing wrong with using htmlTidy and validating locally (using a validator) ;)

ergophobe

4:31 pm on Sep 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I run a validator locally that uses the same engine SP as the W3C site with the advantage that I can actually see, read and change the DTD if I need to. There are some things it doesn't do - like I don't think it validates the character encoding for example, though it does validate entities according to the DTD declared.

I have it set up for essentially one-click validation in Windows. It's a command-line program so you can get almost one-click convenience in *nix (just create a script that is the command line and that takes a file as input so you can type "valid file.html" and that should work if the path is right).

Full instructions at

[ktmatu.com...]

Tom