phax / ph-schematron

Java Schematron library that supports XSLT and native application
Apache License 2.0
115 stars 36 forks source link

Attribute @subject not used for location in SVRL result #133

Closed ericlop closed 7 months ago

ericlop commented 2 years ago

In case of presence, attribute @subject from schematron rule should be used in the SVRL Result instead of context path in the attribute @location . Otherwise, the XML node(s) or attribute(s) which is(are) the cause of the error/warning cannot be retrieved precisely

To be also in compliance with mapping defined in schematron page : https://schematron.com/document/3464.html

Thx,

phax commented 2 years ago

Thanks for the proposal. What "Engine" are you using?

And can you eventually provide a small demo SCH with the usage of this attribute?

ericlop commented 2 years ago

Hello Philip, We're using java "pure".

Our need is to be able to specify one or several node(s)/attributes from context path in a single "subject"/"location". For example, a range of values for which the maximum cannot be less than the minimum :

<rule context="/path/ValueRange">
        <assert id="XXX" subject="@min @max" test="not(@min) or not(@max) or number(@min) &lt;= number(@max)"
                role="ERROR">
               min-max error
        </assert>
    </rule>

If the 2nd ValueRange node in /path does not check this rule, we expect in SVRL result to specify both attributes which cause the assertion failure :

    <failed-assert id="XXX" location="/path/ValueRange[1]/@min /path/ValueRange[1]/@max" test="not(@min) or not(@max) or number(@min) &lt;= number(@max)" role="ERROR">
        <text>
           min-max error
        </text>

Thx, Eric

stale[bot] commented 9 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

phax commented 7 months ago

This is finally contained in v8.0.0