This one is fairly complex.
There are two main problems: firstly, we aren't writing the namespaces out to the SEF file, and secondly, if we do that, the mechanism to read them back in again isn't working properly.
I think this wasn't working in Saxon 10 (ever since the big changes to namespace representation with the intrduction of the NamespaceMap). So I don't think there's an imperative requirement to fix it in a way that's compatible with the SCM files from earlier releases. I would rather output in-scope namespaces in the same way as we do within SEF files. But that (a) involves some refactoring of code to make it reusable, and (b) involves a change to the schema for SCM files.
The basic change is that for the various schema components that include XPath expressions (assertion, alternative, selector, field), we should output an additional attribute containing the namespace bindings in the condensed microsyntax used for SEF files; and when loading SCM files, of course, we read this attribute and set the relevant namespaces in the XPath static context.
While testing this I discovered that the scmschema.scm
file in the samples/scm
directory needs to be updated with a refreshed license key (it's built with a facility not available to ordinary users whereby the license key is embedded in the compiled schema, allowing it to be used for validation without purchasing a separate license).