473,810 Members | 2,935 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Looking for HTML validator

Hi!

I am looking for HTML validator with the following restrictions:
1. Web server is the localhost (page should be validated locally).
2. The page is dynamic (generated by PHP with client side javascript,
which alters the DOM).

I tried the following:
1. Tidy Firefox extenstion (http://users.skynet.be/mgueury/mozilla/).
Unfortunately, it doesn't really makes the real DOM validation. In my
JS code, I had .inerHTML code injection, but this extension didn't show
the injected html code.
2. I am using FireBug Firefox extenstion. This extenstion shows the
real DOM, but unfortunately it doesn't validate the HTML.
3. MS developper toolbar for IE and Web Developper Firefox extenstion
make only external HTML validation.

Any advise?

Thanks a lot!

Vadim

May 15 '06 #1
12 3149
Vadim wrote:
1. Web server is the localhost (page should be validated locally).
http://validator.w3.org/source/
2. The page is dynamic (generated by PHP with client side javascript,
which alters the DOM). 2. I am using FireBug Firefox extenstion. This extenstion shows the
real DOM, but unfortunately it doesn't validate the HTML.


Take the generated markup and paste it into the validator.
--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
May 15 '06 #2
Thanks for help, but it's a liitle difficult to make...
Are there any real-time DOM validators?

May 16 '06 #3
VK

Vadim wrote:
Are there any real-time DOM validators?


There is only one King :-)

You can install Firefox add-on at
<https://addons.mozilla. org/firefox/249/> Please not that HTML Tidy is
called there "HTML Validator" but it is not in the sense of W3C
Validator. Some differences are presented (Tidy is more relaxed in
favor of the real world practice). Yet it is a rather nice markup
checker and pritty-printer. You can use it at the debug time and make
the final validation at validator.w3.or g

May 16 '06 #4
VK wrote:
Are there any real-time DOM validators?
You can install Firefox add-on at
<https://addons.mozilla. org/firefox/249/>
And that does what the author wants? Cool.

Hang on everyone! This is VK! I don't think I've ever responded to one of
his posts without my answer basically boiling down to "You're wrong!", but
I haven't fiddled with this extension before (it is based on tidy, and I
don't much care for tidy's attempts at syntax checking) so how about some
testing?

First I construct a test document...

http://dorward.me.uk/tmp/mod.html

A very simple HTML 4.01 Strict document with two buttons that call
JavaScript functions that modify the document - one uses DOM methods to add
an image that (a) lacks an alt attribute and (b) is being added somewhere
it isn't allowed, the other uses innerHTML to modify the document so the
body looks like:

<body>
</p><p>xxx</p></p>
</body>

Download and install the Tidy extension that VK referenced fire it up
and ...

Valid!

Excellent. It hasn't got any false positives from this documents then. Now
how about we try my scripts.

First the DOM script. Clicky, Clicky. Hmm. Still "valid".

Then the innerHTML script. Clicky, Clicky. Hmm. Still "valid".

So no. It doesn't work as VK claims ... hang on a minute.

Oh my. Why did I bother? I've just gone back and looked at the post that
started this thread. VADIM HAD ALREADY TRIED THAT EXTENSION AND DISMISSED
IT AS NOT DOING WHAT HE WANTED! ARGH!
Please not that HTML Tidy is
called there "HTML Validator" but it is not in the sense of W3C
Validator.
Actually, the current beta has a real SGML parser
Some differences are presented (Tidy is more relaxed in
favor of the real world practice).
No, it isn't. It has bugs, and as far as I'm aware they are recognised as
bugs and not fobbed off as "real world practise", I think you may be mixing
it up with that CSE thingy.
Yet it is a rather nice markup checker and pritty-printer. You can use it
at the debug time and make the final validation at validator.w3.or g


Just so long as you remember to do a proper check and don't get lulled into
a false sense of security.

--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
May 17 '06 #5
VK

David Dorward wrote:
VK wrote:
Are there any real-time DOM validators?
You can install Firefox add-on at
<https://addons.mozilla. org/firefox/249/>


And that does what the author wants? Cool.


OP wanted something to not run after each change to w3.org This is what
has being said in the post I read and answered.
Hang on everyone! This is VK! I don't think I've ever responded to one of
his posts without my answer basically boiling down to "You're wrong!", but
I haven't fiddled with this extension before (it is based on tidy, and I
don't much care for tidy's attempts at syntax checking) so how about some
testing?

First I construct a test document...

http://dorward.me.uk/tmp/mod.html

A very simple HTML 4.01 Strict document with two buttons that call
JavaScript functions that modify the document - one uses DOM methods to add
an image that (a) lacks an alt attribute and (b) is being added somewhere
it isn't allowed, the other uses innerHTML to modify the document so the
body looks like:


I'm missing the point of this exersice. Of course using DOM methods and
even document.write I can bring the runtime document structure in the
state far away from what was originally presented to any validator. So
what's the point? Validator of any kind (including the one at w3.org)
checks the document as it is, not as it will/may be. All victimes of VP
(Validation Psychosis) syndrome do use this fact intensively to cheat
on validator. "Holly hacks" in CSS, <iframe> implantation over
scripting:- it is all to feed into validator a formally valid code
which vould be automatically deployed at runtime into non-so-valid but
functional version.

To check for markup errors client-side HTML Tidy does the trick. If it
is absolutely necessary to know what does W3C think about this code
/exactly/ and /at this given moment/ (as they change their mind rather
often) there is no option but eventually go to

<http://validator.w3.or g/>
and
<http://jigsaw.w3.org/css-validator/>

May 17 '06 #6
VK wrote:
OP wanted something to not run after each change to w3.org This is what
has being said in the post I read and answered.
The OP explicity stated that (a) JavaScript was involved and (b) The
Firefox extension you suggested does not do the job.
I'm missing the point of this exersice. Of course using DOM methods and
even document.write I can bring the runtime document structure in the
state far away from what was originally presented to any validator. So
what's the point?
The point of validation is QA. Presumably the OP wants to maintain that
level of QA as the document is modified by client side scripting (so
that they can identify problems with their script).

Take for example a script which appends "<div><!-- a bunch of a
markup-->" to a document. Since the end tag for the div is missing,
interesting things can happen to the way the document is displayed -
being about to syntax check the generated markup would make it easier
to identify the problem.
Validator of any kind (including the one at w3.org)
checks the document as it is, not as it will/may be. All victimes of VP
(Validation Psychosis) syndrome do use this fact intensively to cheat
on validator. "Holly hacks" in CSS, <iframe> implantation over
scripting:- it is all to feed into validator a formally valid code
which vould be automatically deployed at runtime into non-so-valid but
functional version.
I've no idea what you mean by "<iframe> implantation over scripting",
but my understanding of the Holly Hack is to provide one set of CSS to
some browsers and a different set to others to work around problems
with one group of them - and nothing whatsoever to do with validation.
To check for markup errors client-side HTML Tidy does the trick. If it
is absolutely necessary to know what does W3C think about this code
/exactly/ and /at this given moment/ (as they change their mind rather
often) there is no option but eventually go to

<http://validator.w3.or g/>
and
<http://jigsaw.w3.org/css-validator/>


Except that it is rather difficult to get hold of the markup as
modified by client side scripting.

May 17 '06 #7
VK

David Dorward wrote:
Except that it is rather difficult to get hold of the markup as
modified by client side scripting.
Not "difficult" but not possible, this is what I tried to explain.
Validator doesn't take some imaginary "DOM Tree timestamp" - it takes
raw code and sees if a valid DOM tree can be build out of it.

In theory I can imagine a "reverse engineered" validator which
1) uses a tree walker to get the exact DOM structure of the document at
this given moment.
2) Converts each found node to the relevant HTML representation (objDIV <div>)

3) Builds up a text document with "restored" HTML code
4) Submits this text document to some validator
5) Validator uses this code to build again DOM tree out of it and to
validate it.

Technically it is possible but AFAIK no one made yet such ridiculous
program (though once again technically it is possible).

May 17 '06 #8
VK wrote:
David Dorward wrote:
Except that it is rather difficult to get hold of the markup as
modified by client side scripting.


Not "difficult" but not possible


Really? So how does the ViewRenderedSou rce extension for Firefox get hold of
that then?

http://jennifermadden.com/scripts/Vi...redSource.html

From there it isn't a huge step to feeding it through nsgmls or similar.
In theory I can imagine a "reverse engineered" validator which
1) uses a tree walker to get the exact DOM structure of the document at
this given moment.
2) Converts each found node to the relevant HTML representation (objDIV
<div>) 3) Builds up a text document with "restored" HTML code
4) Submits this text document to some validator
5) Validator uses this code to build again DOM tree out of it and to
validate it.


Congratulations , you've just imagined the "impossible ".
Technically it is possible but AFAIK no one made yet such ridiculous
program (though once again technically it is possible).


And it is ridiculous why? I've already explained the practical value of such
a tool.

--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
May 17 '06 #9
VK

David Dorward wrote:
Technically it is possible but AFAIK no one made yet such ridiculous
program (though once again technically it is possible).


And it is ridiculous why? I've already explained the practical value of such
a tool.


Ridiculous because where to use it? If one retrieves an entire document
over an ajaxoid, then use responseText for validation.

If one adds new elements over createElement/appendChild then on the
level of a single element validation is an over-kill. What ye going to
validate?
var d = document.create Element('DIV');
d.id = 'myDiv';
d.foo = 'bar';
validate(d); // ?

What's the point? You cannot decide yourselve? Also guess what: it is
perfectly valide element. Yes, I added 'foo' property to the DOM
interface, but as an HTML Element it is still perfectly valide
element, unlike if say I would do d.setAtribute(' foo', 'bar'); thus if
I would change the DOM Node structure. In either case do you really
need a validator?

Probably it may get some use if one inserts a bounch of HTML mishmash
right into page over innerHTML. In this case maybe... Ridiculous tools
for ridiculous coding... :-)

May 18 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
6907
by: Akseli Mäki | last post by:
Hi, Hopefully this is not too much offtopic. I'm working on a FAQ. I want to make two versions of it, plain text and HTML. I'm looking for a tool that will make a plain text doc out of the HTML doc. The HTML version doesn't have anything fancy, just internal links. So the tool must be able to delete internal links and anchors from the HTML version, but leave external links in simplified form. That is, the HTML version would say <a...
38
3621
by: Jukka K. Korpela | last post by:
As well all know, valid markup is important... but when trying to find a convincing modern argument in favor of this, I found pages like http://www.htmlhelp.com/tools/validator/reasons.html which was very nice when Netscape ruled the World Wide Web, and http://valet.htmlhelp.com/page/why.html which is very suggestive but does not really give any factual example. Is there something to be _shown_ to people who ask "why validate?"? A page...
195
8638
by: Torbjørn Pettersen | last post by:
As you might have noticed I'm trying to clean up my web site's HTML code. The way I do it is simply more or less redoing to complete site, testing it on a web server I have set up on my local network. I have downloaded, and installed CSE HTML Validator Pro, but I don't get the same results with that as I do with the online validator on W3.org. And I can't upload files to W3.org either, due to all the ASP code I use.
5
5789
by: HchC | last post by:
Not looking for a special or fancy css stylesheet. For a HTML beginner, stylesheet is still far away from now. Not even said thinking about cross browser. But, an XHTML page without stylesheet look ugly. SO, I am looking for a "cross browser" "general" stylesheet that can be apply to a general HTML page.
4
1940
by: pcunix | last post by:
I'm looking for general advice, pointers to web pages, books, whatever. I have a moderately successful web site. The major complaint that I get, time after time, is "It's UUUGLY" As I have explained at http://aplawrence.com/Blog/B1228.html , I understand that, and to some extent it's deliberate: I am NOT looking for flash over content and I want my pages to remain fast, Lynx friendly, and easy to read.
4
1379
by: Michael Schuerig | last post by:
I'm working primarily on Linux with Konqueror. To Firefox I resort only for testing compatibility and when I need some feature from its Web Developer extension. Thus my perspective is probably rather narrow. My work with CSS all happens at a low level of abstraction. Basically, I edit stylesheets by hand and get some abstraction by using a preprocessor that allows me to use constants. I'm curious whether there are tools that make working...
40
5624
by: VK | last post by:
Hi, After the response on my request from W3C I'm still unclear about Tidy vs. Validator discrepansies. That started with <IFRAME> issue, but there is more as I know. Anyway, this very basic HTML page: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html401/strict.dtd"> <html> <head>
78
4927
by: Robert Baer | last post by:
The homepage i have had up and seemingly working is: http://oil4lessllc.com/ However, the validator has so many complaints, and being so incompetent, i have no clue as to how to fix it all. Would the use of Dreamweaver be of great help?
2
1657
by: lorlarz | last post by:
Looking for feedback on Matching Exercises Maker/ Builder: http://mynichecomputing.com/ReadIt/translateT.html For one thing, I am concerned about storing the matching kwork (known word) as the className of the li which is the answer. I think this may be problematic. I also worry about using the ul as the container for the whole thing.
0
9722
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10124
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6882
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4334
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3863
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.