Is there a way I can write or extend a validator (I'm thinking
relaxng) that would test my xhtml files to insure they have the proper
structure?
What kind of constraints are you trying to enforce? Since XHTML is an
XML language, you could create an extended XHTML Schema which enforced
your additional constraints; you could also use XHTML modularity to add
elements from another namespace (and another schema working alongside
the standard XHTML).
But XML Schemas are focused very much on document structure and
datatypes; they don't handle interactions between specific data values.
RelaxNG or Schematron or some of the other secondary tools have
different tradeoffs and may or may not handle constraints that can't be
expressed easily in schemas.
But remember: Schema-level validation is very much about the next level
of language syntax above the basic XML layer. Validating semantics is
something that should be handled in the application layer. You can
certainly write applications to check XML documents for anything you
could possibly want to check them for, limited only by your own
programming skill -- start with a standard XML API like SAX or DOM and
run your algorithm on top of that. Of course that requires that you be
able to install that code on the machine which should do the checking.
--
Joe Kesselman,
http://www.love-song-productions.com/people/keshlam/index.html
{} ASCII Ribbon Campaign | "may'ron DaroQbe'chugh vaj bIrIQbej" --
/\ Stamp out HTML mail! | "Put down the squeezebox & nobody gets hurt."