RE: [NH] LOCAL XHTML TESTING
>Hi,<?xml version="1.0" encoding="UTF-8"?> //this will trigger quirks, get rid
>I'm an experienced real time software engineer getting involved in
>Web design. I have done a lot of reading, both books and web pages
>and, after a lot of heart searching, have arrived at the following
>strategy for developing web pages:
>1. Develop and test the site initially using an XHTML 1.0 strict
>DOCTYPE until I have the site working to my satisfaction. This will
>be done locally on my PC (I will not upload the site). I hope that
>this will set me on the right road to producing well formed XHTML
>code which will be ready when more browsers (IE) support XHTML. I
>intend to follow the W3C compatibility rules (Annex C) to make sure
>that my XHTML is backwards compatible with HTML.
>2. I realise that there are difficulties presenting XHTML to some
>browsers (IE in particular) and that I will end up with the browser
>treating my code as HTML in "quirks" mode.
Only if you put the xml proccessing instruction on top of the Doc..
otherwise quirks mode is not triggered.
>For that reason I intendWhy?
>to change to HTML 4.01 strict DOCTYPE before going live and carrying
>out validation and final testing.
Leave the DOCTYPE as xhtml strict.
give it a html or htm extension and the server will serve it as text/html
your browser is happy ... it loads and parses as an html doc
however your doc is now bipolar..
can be loaded into sgml parser( a browser ) and rendered like html..
can be loaded into xml parser ( may be a xml parser in a browser, maybe not
>That's the background. The question is what is the best way ofThe way i do it is to load it into a validating xml parser..
>testing and validating my XHTML code locally?
msxml 4 does the trick..
I've got a little notetab clip that
replaces the Public Doctype to a local one
^!Set %dtSystem%=<!DOCTYPE html SYSTEM "^$GetAppPath$DTD\xhtml1-strict.dtd">
it then calls a script from WSH
^!Set %out%=^$StrTrim(^$GetInputOutput(cscript "^%file%" "^%arg%"
the ^%file% contains the following..small jscript
var stdout = WScript.StdOut;
var file = WScript.Arguments.Unnamed(0)
//instantiate latest msxml parser
x = new ActiveXObject("Msxml2.DOMDocument.4.0");
x.async = false;
x.validateOnParse = true;
x.resolveExternals = true;
var err = x.parseError
if(err.errorCode != 0)
stdout.WriteLine('line:#: ' + err.line + ' ');
stdout.WriteLine('linepos: ' + err.linepos);
stdout.WriteLine("Valid against strict DTD " + x.parsed)
I replace the doctype back ..
and go to position curser at line error if there is one...
^!IfTrue ^%Public% ^!Replace "^%dtSystem%" >> "^%dtPublic%" CIWHS
Viola its done ...
file is validated against the DTD and this is done locally
>I am not very clear howCSE HTML Validator Lite - it's free:
>browsers, validators/linters, Tidy etc manage doctypes when looking
>at code. How can I be sure that they are treating the code as XHTML
>1.0 strict and not HTML?
>Can anyone point me at any interesting sites or offer any suggestions?
Fookes Software Home: http://www.fookes.us/redir
Yahoo! Groups Sponsor
Yahoo! Groups Links
To visit your group on the web, go to:
To unsubscribe from this group, send an email to:
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
- Hi again,
Thanks to everyone who replied.
I thought I had done a lot of reading on the subject but you've given
me lots to think about. I definitely understand the DOCTYPE and
rendering thing a lot better now.