You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
XQS is an emerging XQuery-based implementation of Schematron. Its status as of 11/2023 is "pre-release." https://github.com/AndrewSales/XQS
It would be useful if XQS users could run XSpec tests against their Schematron code. But not every Schematron schema that runs with XQS will run with an XSLT-based implementation of Schematron. In particular, XQS-compatible Schematron schemas are allowed to include user-defined functions written in XQuery (just as SchXslt-compatible Schematron schemas are allowed to include user-defined XSLT functions).
When XSpec compiles a test for Schematron, it generates XSpec code that runs against a compiled-to-XSLT form of the schema. Can we provide an option to generate XSpec code that runs against a compiled-to-XQuery form of the schema? Long term, perhaps XSpec would support both SchXslt and XQS as Schematron implementation options.
I did a little exploring and noticed a few things that would be needed. This is not a comprehensive list.
The XSpec compiler needs to know which implementation to use. Should the decision use environment variables, Ant properties, the queryBinding attribute in the Schematron schema, some markup in the XSpec test, or something else? (The answer might even be a combination, and it might change as XQS matures.)
The generated XSpec code needs to locate the XQS implementation, and we'd need to determine how to access XQS. xqs:validate() is a candidate if the user's XQuery engine is BaseX. Alternatively, xqs:compile() creates code that is apparently portable across XQuery engines, so it would be nice if such a compilation result could be used by XSpec.
The generated XSpec code needs to express the context to validate in terms of x:call because XSpec tests for XQuery code do not use x:context.
In the generated XSpec code, x:expect/@test attributes should use $x:result instead of assuming a context item exists, because XSpec tests for XQuery code do not define a context item in x:expect/@test. This change affects several lines like this.
@xslt-version is not relevant when the generated XSpec code targets XQuery.
Either src/schematron/select-node.xsl needs a corresponding XQuery implementation, or the generated XSpec code needs to replace calls to functions in that module with something else.
XQS is an emerging XQuery-based implementation of Schematron. Its status as of 11/2023 is "pre-release."
https://github.com/AndrewSales/XQS
It would be useful if XQS users could run XSpec tests against their Schematron code. But not every Schematron schema that runs with XQS will run with an XSLT-based implementation of Schematron. In particular, XQS-compatible Schematron schemas are allowed to include user-defined functions written in XQuery (just as SchXslt-compatible Schematron schemas are allowed to include user-defined XSLT functions).
When XSpec compiles a test for Schematron, it generates XSpec code that runs against a compiled-to-XSLT form of the schema. Can we provide an option to generate XSpec code that runs against a compiled-to-XQuery form of the schema? Long term, perhaps XSpec would support both SchXslt and XQS as Schematron implementation options.
I did a little exploring and noticed a few things that would be needed. This is not a comprehensive list.
The XSpec compiler needs to know which implementation to use. Should the decision use environment variables, Ant properties, the queryBinding attribute in the Schematron schema, some markup in the XSpec test, or something else? (The answer might even be a combination, and it might change as XQS matures.)
The generated XSpec code needs to locate the XQS implementation, and we'd need to determine how to access XQS.
xqs:validate()
is a candidate if the user's XQuery engine is BaseX. Alternatively,xqs:compile()
creates code that is apparently portable across XQuery engines, so it would be nice if such a compilation result could be used by XSpec.The generated XSpec code needs to express the context to validate in terms of
x:call
because XSpec tests for XQuery code do not usex:context
.In the generated XSpec code,
x:expect/@test
attributes should use$x:result
instead of assuming a context item exists, because XSpec tests for XQuery code do not define a context item inx:expect/@test
. This change affects several lines like this.@xslt-version
is not relevant when the generated XSpec code targets XQuery.Either
src/schematron/select-node.xsl
needs a corresponding XQuery implementation, or the generated XSpec code needs to replace calls to functions in that module with something else.Cc: @AndrewSales, @adamretter, @vincentml
The text was updated successfully, but these errors were encountered: