Subject: Re: [xsl] How to read Schema XSD in stylesheet XSL!|
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Thu, 29 Nov 2007 23:59:54 +0100
Abel Braaksma wrote:
In all honesty, all you need is an XML processor that supports Schema processing. You do not need any XSLT. But if you are determined to use XSLT, just use XSLT 2.0 with validation (available with Saxon-SA and AltovaXML, the latter free). If the content is valid, output "yes", if not,. output "no". For all that I know, you can write any stylesheet (as long as validation is on) and let it output something. If the output is nothing or an error or a different exit code, you let your calling process (i.e., a batch file or a workflow system) output "no". Or, like Wendell suggested, use the extension functions of Saxon.
Note that you don't need SaxonSA to do schema-validated XSLT processing of documents, you just need to use a parser that is both schema-aware (e.g., Xerces) and is configured to do schema validation. This requires a small bit of Java code or doing the necessary Java system property configuration to set it up.
What you need SaxonSA for is to do schema *aware* XSLT processing such that you can refer to data types and complex types defined in your schema in your XSLT templates.
Cheers, -- Abel Braaksma