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.