Skip to content
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.

attribute nodes in context of schematron rule #44

Closed
andreastai opened this issue May 2, 2017 · 4 comments
Closed

attribute nodes in context of schematron rule #44

andreastai opened this issue May 2, 2017 · 4 comments

Comments

@andreastai
Copy link

This may be related to #29.

Source Document

<bar foo="value"/>

Schematron Schema

<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
    <sch:pattern>
        <sch:rule context="@foo">
            <sch:assert test="false()">There should be no foo attribute.</sch:assert>
        </sch:rule>
    </sch:pattern>
</sch:schema>

The XSLT from the schema is compiled with iso_svrl_for_xslt2.xsl.

The compiled schematron XSLT does not fire for the attribute @foo. Attributes in general (given as context) seem not to work.

The schematron implementation in @oxygenxml provides the expected error.

Is this a bug in the skeleton implementation?

@PStellmann
Copy link

There is a "visit-no-attributes" option to improve performance when there is no need to check the attributes. Seems like this is enabled for you. For oXygen you can check and change it in options -> XML -> XML-Parser -> Schematron.

@andreastai
Copy link
Author

andreastai commented May 2, 2017

Thanks for your comments, @PStellmann!

There is a "visit-no-attributes" option to improve performance when there is no need to check the attributes.

Yes. I noticed that. In the iso_svrl_for_xslt2.xsl is a corresponding parameter:

<xsl:param name="optimize" />

The inline comments describe this as follows

<!-- optimize     
     "visit-no-attributes"     
    Use only when the schema has no attributes as the context nodes--> 

Seems like this is enabled for you.

I commented this parameter out, with no changed behavior. In fact this parameter is never used in the XSL, so seems not to do anything.

For oXygen you can check and change it in options -> XML -> XML-Parser -> Schematron.

Thanks for the hint. I wasn't aware of it. But as said @oxygenxml does it right from the beginning. It is the xsl of this skeleton implementation that has this unexpected behavior. I think that @oxygenxml may be build on this implementation but modified it for the editor.

@andreastai
Copy link
Author

I oversaw that iso_svrl_for_xslt2.xsl actually imports iso_schematron_skeleton_for_saxon.xsl. Here the PR #41 solves the issue.

As this issue is a duplicate issue to #29 I will close this issue. The problem with the optimize parameter may be still a bug but I will open a new issue if I can confirm this.

@octavianN
Copy link

octavianN commented May 3, 2017

There are some modifications in the Schematron implementation from oXygen. We are using an older version of skeleton stylesheets, but we want to update the them to use the latest version.
The optimeze parameter was replaced with the attributes parameter in the latest Schematron implementation.
Yes, the problem in your case is the one described in #29, with the parent::node().

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants