By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,374 Members | 1,789 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,374 IT Pros & Developers. It's quick & easy.

validation utility?

P: n/a
If someone were to write a utility that would go through your html,
and javascript code and validate it/modify it, what language/
technology would you experts suggest I use? I know that the W3C
already does this, but I wanted to write something simple on my own
just for learning purposed. Anyway, I was thinking about using C# or
javascript, that would accept the files, and then call some external
objects/classes to handle the parsing and manipulation of the files. I
guess what I was wondering is if there is a better alternative or an
open source project I could modify to handle this?
THanks

Nov 14 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a
In article <11**********************@k79g2000hse.googlegroups .com>, carlos <ca***********@gmail.comwrote:
>If someone were to write a utility that would go through your html,
and javascript code and validate it/modify it, what language/
technology would you experts suggest I use? I know that the W3C
already does this,
Right, so why re-invent the wheel?
but I wanted to write something simple on my own
just for learning purposed.
Then I suggest you start with a simple project.

This isn't it.

--
Regards,
Doug Miller (alphageek at milmac dot com)

It's time to throw all their damned tea in the harbor again.
Nov 14 '07 #2

P: n/a
In comp.lang.javascript message <11**********************@k79g2000hse.go
oglegroups.com>, Wed, 14 Nov 2007 14:44:34, carlos
<ca***********@gmail.composted:
>If someone were to write a utility that would go through your html,
and javascript code and validate it/modify it, what language/
technology would you experts suggest I use? I know that the W3C
already does this, but I wanted to write something simple on my own
just for learning purposed.
Full validation is a major project, unsuitable for anyone who is leaning
either the coding language or the language being validated.
Anyway, I was thinking about using C# or
javascript, that would accept the files,
Since this would be a text processing project, you would need good text-
processing routines. Javascript has RegExps; C# may need library
routines.
and then call some external
objects/classes to handle the parsing and manipulation of the files.

You might find it appropriate to code, for practice or use, something
that helps with some of the problems of finding where the actual error
is in incorrect code.

For example, within <URL:http://www.merlyn.demon.co.uk/js-quick.htmI
have a routine to indent Javascript in accordance with its {...}
structure (provided that within a line {...} within strings and comment
balance); and in <URL:http://www.merlyn.demon.co.uk/js-misc1.htm#DCI
have a utility for checking day-of-week in HTML.

I also have a Batch file to generate indented index lists for headings
in HTML pages (also with provisos, but ones easy to accept).

Start with something reasonably simple; and before that do something
easy.

It's a good idea to read the newsgroup c.l.j and its FAQ. See below.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6
news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>.
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Nov 14 '07 #3

P: n/a
On Nov 14, 2:18 pm, Dr J R Stockton <j...@merlyn.demon.co.ukwrote:
In comp.lang.javascript message <1195051474.265340.267...@k79g2000hse.go
oglegroups.com>, Wed, 14 Nov 2007 14:44:34, carlos
<carlos4ubu...@gmail.composted:
If someone were to write a utility that would go through your html,
and javascript code and validate it/modify it, what language/
technology would you experts suggest I use? I know that the W3C
already does this, but I wanted to write something simple on my own
just for learning purposed.

Full validation is a major project, unsuitable for anyone who is leaning
either the coding language or the language being validated.
Anyway, I was thinking about using C# or
javascript, that would accept the files,

Since this would be a text processing project, you would need good text-
processing routines. Javascript has RegExps; C# may need library
routines.
and then call some external
objects/classes to handle the parsing and manipulation of the files.

You might find it appropriate to code, for practice or use, something
that helps with some of the problems of finding where the actual error
is in incorrect code.

For example, within <URL:http://www.merlyn.demon.co.uk/js-quick.htmI
have a routine to indent Javascript in accordance with its {...}
structure (provided that within a line {...} within strings and comment
balance); and in <URL:http://www.merlyn.demon.co.uk/js-misc1.htm#DCI
have a utility for checking day-of-week in HTML.

I also have a Batch file to generate indented index lists for headings
in HTML pages (also with provisos, but ones easy to accept).

Start with something reasonably simple; and before that do something
easy.

It's a good idea to read the newsgroup c.l.j and its FAQ. See below.

--
(c) John Stockton, Surrey, UK. ?...@merlyn.demon.co.uk Turnpike v6.05 IE 6
news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>.
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Thanks for the comments!

I think my post may have came across the wrong way, for I am not
trying to re-invent any validation programs like the WSC. I do realize
that validating againts all those cases is difficult. However, I used
that as an example, because I would like to do something simple like
check for a specific typo in my javascript code(Just one or two
though!!!). That is what I meant when I said that my implementation
would be simple.
I will look into what Dr JR Stockton suggested.

Thanks
Nov 15 '07 #4

P: n/a
carlos said the following on 11/15/2007 12:44 AM:

<snip>
Thanks for the comments!

I think my post may have came across the wrong way, for I am not
trying to re-invent any validation programs like the WSC. I do realize
that validating againts all those cases is difficult. However, I used
that as an example, because I would like to do something simple like
check for a specific typo in my javascript code(Just one or two
though!!!). That is what I meant when I said that my implementation
would be simple.
If all you want is something to check your JS for typos and the like,
JSLint already does that along with more:

<URL: http://www.jslint.com/>

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 15 '07 #5

P: n/a
In comp.lang.javascript message <bs*********************@giganews.com>,
Sun, 18 Nov 2007 01:02:10, Randy Webb <Hi************@aol.composted:
>Dr J R Stockton said the following on 11/17/2007 5:45 PM:
>In comp.lang.javascript message <Eq*********************@giganews.com>,
Sat, 17 Nov 2007 13:27:26, Randy Webb <Hi************@aol.composted:
>>Dr J R Stockton said the following on 11/16/2007 8:23 AM:
And, *no* utility could ever find all typos without human
intervention.
There was no claim made that one could find *all*. Finding some is of
some use.
>>>"Its not likely to have among it's powers that of being able to find
the errors in this string.";
>I didn't say they aren't. I wrote "There are no *JS* errors in that
string ....". Perhaps you should read what I wrote more carefully and
realize that I was not referring to grammatical errors when I wrote "JS
errors".
Indeed; but you should acknowledge that I write the string, and I did
not impose that limitation. Errors which are not code errors are worth
finding.

--
(c) John Stockton, Surrey, UK. ??*@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/- FAQish topics, acronyms, & links.
Check boilerplate spelling -- error is a public sign of incompetence.
Never fully trust an article from a poster who gives no full real name.
Nov 18 '07 #6

P: n/a
Dr J R Stockton said the following on 11/18/2007 2:29 PM:
In comp.lang.javascript message <bs*********************@giganews.com>,
Sun, 18 Nov 2007 01:02:10, Randy Webb <Hi************@aol.composted:
>Dr J R Stockton said the following on 11/17/2007 5:45 PM:
>>In comp.lang.javascript message <Eq*********************@giganews.com>,
Sat, 17 Nov 2007 13:27:26, Randy Webb <Hi************@aol.composted:
Dr J R Stockton said the following on 11/16/2007 8:23 AM:

>And, *no* utility could ever find all typos without human
intervention.

There was no claim made that one could find *all*. Finding some is of
some use.
And that is what JSLint does. Geez.
>>>>"Its not likely to have among it's powers that of being able to find
the errors in this string.";
>I didn't say they aren't. I wrote "There are no *JS* errors in that
string ....". Perhaps you should read what I wrote more carefully and
realize that I was not referring to grammatical errors when I wrote "JS
errors".

Indeed; but you should acknowledge that I write the string, and I did
not impose that limitation. Errors which are not code errors are worth
finding.
I never said you did impose that limitation. I said there were no "JS
Errors" to be found in a string that you said JSLint couldn't find
errors in. Stop waffling.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 19 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.