|
Posted by Andy Dingley on 12/19/05 14:43
On Mon, 19 Dec 2005 11:56:23 +0000, Jim Higson <jh@333.org> wrote:
>I've used various HTML validators that grab the (X)HTML and run it against a
>schema, but what about validating the 'live' HTML once the DOMs been
>modified by a script?
When modifying the page, modify the DOM (by adding elements to it)
rather than trying to modify the page source (with document.write() )
This will become increasingly important as we move towards XHTML being
processed as XML.
This doesn't guarantee that the page will be valid, but it does preserve
well-formedness at least, and that's most of the battle.
It would be an interesting exercise to write a FireFox extension that
validated the DOM's current contents, rather than the original source.
You already have most of the hooks in place to do this - FF makes it
quite easy to get the "rendered" source, which I think is tracking the
state of the page that you need (I've certainly manually cut and pasted
this into validators)
[Back to original message]
|