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 11:43:10 -0000
# I'm writing a lengthy transform for some xml data for which I 
# have a detailed xsd file. It occurs to me that as a useful, 
# quick validation to ensure that I have spelled node names 
# right and got paths correct, it would be great to be able to 
# validate my xslt against the schema for the document I want 
# to transform. This way, if I tried to follow a path that did 
# not exist or access a node name that was not permitted in the 
# document, I would get a warning message.

This is one of the aims of the integration between XSLT and XML Schema that
comes with XSLT 2.0.

Unfortunately, despite an immensely complex type system designed to achieve
this integration, the simple goal of spotting spelling mistakes in path
expressions isn't fully achieved, because rules in stylesheets can't be tied
statically to specific documents. However, I would expect that XSLT 2.0
implementations will fill this gap by at least giving you warnings. 

Michael Kay

Current Thread