2007-02-18T08:32:55Z
Dave Pawson.
link
Home
Schematron XSLT2.0
Finished. As much as I can first pass. I now have (many thanks to Florent Georges for his help) a Schematron implementation for XSLT 2.0 which covers all of the spec. I wrapped up some bugs in the combined include and abstract file, removed some more mismatched parameters (from XSLT 1.0 use), then changed over to using version='2.0' in the stylesheet element. I now have 8 seperate test files which all pass - though I need to run a diff on an expected results to fully automate testing. I will do that, once I've removed the date of test inclusion.
What remains? More thorough testing, silly things like the use of 'true' or 'yes' as parameter values, which is inconsistant in the schematron.com version. There's a niggle too in the string comparisons throughout. Empty testing, testing for values which also have white space etc. That needs cleaning up. The use of diagnostics is currently recursive using substring-before and substring-after, I'm tempted to re-write that using analyze-string. I doubt the current version would survive much stress testing. I also need to check the input Schematron file is actually targeted at XSLT 2.0 and reject it if it isn't. Though that could do with more thought first. It's largely down to the template that generates the document element in the interim stylesheet, it should be manageable without rejecting non-XSLT2 targets. Whether that is the right approach or not I'm less sure. Basically I think I can process any schematron file meant for XSLT processing, possibly more. The subtleties of the standard need more study. Then I need to check the schematron files with the schematron checker. Bit incestuous, but certainly worth doing.
I'm slowly becoming disillusioned with the schema for schematron. It mainly centres round the use of a pattern named 'foreign' almost everywhere. I can understand it, seeming to allow non schematron namespaced content through to the final output. Yet the pattern allows Schematron namespaced content through! A pattern called foreign-empty which simply wraps another pattern foreign-attributes. Again no differentiation between namespaces. I've no idea what that pattern is for. Rightly or wrongly I've modified my schema to tighten up the constraints.
The use of keys is puzzling. XSLT says that they can appear at the top level or within a template. So far I haven't tried one within a template (derived from a rule element in the schematron file), which I must do. I've only run tests through using a top level key so it is worth testing.
Quite pleased so far. I'll add it to my website when it's ready.
Keywords: schematron
Comments (View)Return to main index