This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: DTD Files !



> 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="*">
<xsl:message>
Unknown element <xsl:value-of select="name(.)"/>
</xsl:message>
</xsl:template>

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

David


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]