Boyd, Todd M. wrote:
Before some of you newbies feel like being heroes and jump all over me:
I KNOW THIS IS A PHP-RELATED LIST. IF YOU DON'T LIKE MY QUESTION, DON'T
ANSWER IT.
Now that that's out of the way... I have a Javascript question (and
maybe a Browser/DOM question) for you folks. I'm not sure this is
anything they teach you in any online/in-seat/self-taught Javascript
course that I've ever seen before, so I figured I would bring it here.
My boss asked me if I knew of a tool that would change the <!DOCTYPE> of
a page on-the-fly to test validation in different schemes (i.e., XHTML
Strict, Transitional, Loose, etc.).
The validators generally don't trigger javascript.
I use DOMDocument to create a valid xhtml page and then before sending
it to the browser - if the browser does not report accepting valid xhtml
(or I specify I want html) it filters the page to valid html 4.01.
That's probably what you want to do - code for valid xhtml and filter
the output to other DTD's you want to make available server side rather
than trying to use JS to alter the DOCTYPE.
Remember, the proper header to send also relies on the DOCTYPE so if you
sent a header for xhtml but send html (or vice versa) you are still
breaking the standard regardless of how pristine your output is.
Another advantage to building the document ahead of time and doing any
translations server side is you can also filter the output for XSS in
case you missed validating some input.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php