[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Validating xslt against a schema for the document I want to transform


Subject: RE: [xsl] Validating xslt against a schema for the document I want to transform
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Wed, 24 Mar 2004 13:27:58 -0000

# This is interesting. Assuming v2.0 is backwardly compatible, 
# presumably I could just run my existing transform through a 
# suitable processor (changing the version at the top of the 
# XSLT script) and get the warnings I want.
# 
# I notice the latest version of Saxon implements the XSLT 2.0 
# specification but you didn't suggest using it. Does it not 
# currently integrate with Schema in this way, or not give 
# warnings when rules are violated?

I haven't yet released a schema-aware processor. I've done a fair bit of the
development, and am currently testing. But at the moment, it isn't doing any
compile-time checking of the stylesheet against the schema - only run-time
validation of the source and result documents (which is still very useful).

Simply importing a schema into your stylesheet may not work in quite the way
you imagine. The system will start taking note of the data types declared in
your schema, which may result in errors being reported (e.g. if you use a
string as a number) and it may lead to comparisons producing different
results (e.g. @a=@b being a numeric comparison rather than a string
comparison).

Michael Kay


Current Thread
Keywords