Re: [xsl] How to read Schema XSD in stylesheet XSL!

Subject: Re: [xsl] How to read Schema XSD in stylesheet XSL!
From: Eliot Kimber <ekimber@xxxxxxxxxxxx>
Date: Thu, 29 Nov 2007 12:01:13 -0600
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.



Eliot Kimber
Senior Solutions Architect
"Bringing Strategy, Content, and Technology Together"
Main: 610.631.6770

Current Thread