-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Content of role attributes #665
Comments
@vincentml |
The current list of <xsl:variable name="error" select="('error', 'fatal', 'ERROR', 'FATAL')"/>
<xsl:variable name="warn" select="('warn', 'warning', 'WARN', 'CAUTION')"/>
<xsl:variable name="info" select="('info', 'information', 'INFO', 'HINT')"/> The suggested documentation change is also a good improvement. In conjunction with the code change, the text would change to include the new values. In this context it is probably also good to mention that role values are user defined. So the new text would be: x:expect-valid verifies that the Schematron is executed and passes validation. In the Schematron an assert or report can have a role attribute specifying that it is an error (value 'error', 'fatal', 'ERROR' or 'FATAL'), a warning (value 'warn', 'warning', 'WARN', or 'CAUTION') or an informational message (value 'info', 'information', 'INFO', or 'HINT'), or potentially other user-specified values. A role attribute not equal to 'error', 'fatal', 'ERROR', or 'FATAL' is considered to be allowed for a passing validation. |
Thanks @vincentml ! @heidivanparys |
Thanks for looking at this issue. I have one comment: how about making all values case-insensitive (from a user-perpective)?: <xsl:variable name="error" select="('error', 'fatal', 'ERROR', 'FATAL')"/>
<xsl:variable name="warn" select="('warn', 'warning', 'caution, 'WARN', 'WARNING', 'CAUTION')"/>
<xsl:variable name="info" select="('info', 'information', 'hint', 'INFO', 'INFORMATION', 'HINT')"/> The text in the wiki would then have to be updated accordingly. |
If the values were compared in a case-insensitive way then XSpec may be more forgiving of typos than might be expected by a user or some other environment in which Schematron runs. For example, "erROR" would probably be considered incorrect. I think it is better to have a defined list of all lower case and all upper case versions of each value to encourage consistency, but an argument could be made that a case insensitive comparison would be more user friendly. Researching this, the logic that oXygen uses to determine severity is documented here:
When editing Schematron files in oXygen the suggested values for the role attribute are:
A quick test in oXygen of all upper case, all lower case, and mixed-case variants shows that oXygen does use a truly case-insensitive comparison for the role attribute values. To match oXygen's treatment of the role attribute values I think the variables that we've been discussing should be defined using all lower case values, e.g.
The code generation for comparison of the role attribute value in schut-to-xspec.xsl#L183 can be changed to be case insensitive by:
|
@heidivanparys or @vincentml
|
I could create a pull request. I won't manage to do that this week but next week should be possible. |
@AirQuick I'm making only little progress with this unfortunately. I followed https://github.com/xspec/xspec/wiki/How-to-Run-the-Test-Suite-Locally . I managed to install the dependencies correctly by using a modified version of test\ci\install-deps.cmd , as I have an older Windows version, see heidivanparys@ddb721e Then I created a Schematron file, an XSpec test, and did an attempt to describe (part of) the expected outcome, see heidivanparys@5e286e0 I cannot get what is described at https://github.com/xspec/xspec/tree/master/test/end-to-end to work, I get an error:
Would it be possible to get some more guidance on how many files and what kind of files should be added, and what the process is to create a complete test case? |
@heidivanparys
Thanks for making it. I'll try to incorporate it. (#692)
Looks like the test processor needs to be updated to handle this new pattern. I'll fix it asap. (#693) |
Fixed it in #694. I believe the test will work on the current master. |
Yes indeed.
Thanks, that made sure I didn't get the same error anymore. |
Assuming we're merging #705 soon, I updated Wiki based on @vincentml 's suggestion. (diff) |
When creating my first tests using XSpec, I tested a Schematron file that used asserts with role attribute set to ERROR, as described on http://schematron.com/2018/12/standard-severity-levels-with-schematron-role/ :
This resulted in
x:expect-valid
not working as I expected it to work.When looking at the xspec code, I then found out that lowercase roles are used:
xspec/src/schematron/schut-to-xspec.xsl
Line 12 in 877ed42
xspec/src/schematron/schut-to-xspec.xsl
Line 181 in 877ed42
As a minimum, I think an update of https://github.com/xspec/xspec/wiki/Writing-Scenarios-for-Schematron is needed. Currently is says:
This could e.g. be changed to:
x:expect-valid
verifies that the Schematron is executed and passes validation. In the Schematron an assert or report can have a role attribute specifying that it is an error (value 'error' or 'fatal'), a warning (value 'warn' or 'warning') or an informational message (value 'info' or 'information'). A role attribute not equal to 'error' or 'fatal' is considered to be allowed for a passing validation.A more advanced solution could be to extend the values XSpec can recognize (lowercase vs. uppercase, and the addition of the values described at http://schematron.com/2018/12/standard-severity-levels-with-schematron-role/ )
The text was updated successfully, but these errors were encountered: