Re: DTD Files !

Subject: Re: DTD Files !
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 9 May 2000 16:47:37 +0100 (BST)
> or are suggesting to test for everything that you want, and if you don't
> get a true test then give an error?  

Yes that, exactly.

You can write XSL transforms that do nothing but walk over the input
tree and make error messages about things they find but don't like.
You can write these by hand or schematron will write them for you.

You can make far more specific constraints this way that are expressable
using a DTD, for example you can force that certain elements are non
empty, or only have digits in their content, or force that an attribute
appears on an element or any of its ancestors.

The validation is fully namespace aware so the document can use any
prefixes it likes which is basically impossible with DTD, 

If you are writing it yourself you just start with

<xsl:template match="*">
Unknown element <xsl:value-of select="name(.)"/>

which doesn't allow anything, and then you add templates for things you do
want to allow.


 XSL-List info and archive:

Current Thread