Skip to content
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

add <constraintDecl> #2594

Merged
merged 9 commits into from
Dec 18, 2024
Merged

add <constraintDecl> #2594

merged 9 commits into from
Dec 18, 2024

Conversation

sydb
Copy link
Member

@sydb sydb commented Sep 20, 2024

Added <constraintDecl> element.

Copy link
Contributor

@raffazizzi raffazizzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested different content models for contraintDecl and encodingDesc

P5/Source/Specs/constraintDecl.xml Show resolved Hide resolved
P5/Source/Specs/encodingDesc.xml Show resolved Hide resolved
@ebeshero ebeshero self-requested a review October 30, 2024 00:12
@ebeshero
Copy link
Member

I resolved the merge conflict over TD (to reconcile the new material about constraintDecl with another update earlier in the chapter--may want to take a look at TD, but I think this is what we want.

Copy link
Member

@ebeshero ebeshero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything works here: all tests are passing, the Guidelines build and validate. Also,<constraintDecl> is functioning in a tester ODD I created from the CBML ODD with a new Schematron rule and an application of <constraintDecl>.

There's one thing that's bothering me about the expected behavior of <constraintDecl> as exemplified in its element spec.

We have this in the egXML:

   <constraintDecl scheme="schematron" queryBinding="xslt3">
        <sch:ns prefix="wwp" uri="http://www.wwp.northeastern.edu/ns/textbase"/>
      </constraintDecl>

But that does not work in my ODD to RNG transformation. The output RNG doesn't show an error, but when applied to a validate an XML file, validation fails due to an error over the unrecognized namespace (the one declared as shown in the egXML).

To make this work, I had to modify my tester ODD to set the <sch:ns/> element (with its @prefix and @uri inside the <constraint> of my <constraintSpec>--it had to be set in the immediate content of a schematron rule. I think this wasn't the intention /expected behavior of constraintDecl was it?

I'm attaching my tester files, built on the CBML ODD with a simple Schematron test on cbml elements.
out-PR2594.zip

<exemplum xml:lang="en">
<egXML xmlns="http://www.tei-c.org/ns/Examples">
<constraintDecl scheme="schematron" queryBinding="xslt3">
<sch:ns prefix="wwp" uri="http://www.wwp.northeastern.edu/ns/textbase"/>
Copy link
Member

@ebeshero ebeshero Oct 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code does not function to deliver a specialized namespace to the constraintSpecs that evoke it, but we don't see this until we attempt to validate XML with the output RNG. I had to declare the sch:ns later on within the <constraintSpec> (immediately within a <constraint> element) for it to be recognized by Schematron and function for validation.

@sydb
Copy link
Member Author

sydb commented Nov 27, 2024

I cannot tell if @ebeshero means we should not merge this PR until Stylesheets#697 has been addressed, or she was just not aware that it has not been addressed. Thus this PR now NEEDS DISCUSSION to figure that out. Personally I would like to see this handled pretty quickly, as several major files are changed and I would just as soon avoid a merge nightmare.

@ebeshero
Copy link
Member

@sydb It was probably this: "she was just not aware that it has not been addressed". Shall we address TEIC/Stylesheets#697 then?

@sydb
Copy link
Member Author

sydb commented Dec 17, 2024

Suppose so. I am not sure why @trishaoconnor (& I) put the PENDING label on it. Seems to me we are good to go for someone to do it and generate PR, no? I am not very familiar with the odds/teiodds.xsl code, but since (IIRC) there is no way to assert a query language binding when Schematron occurs inside RELAX NG, this may be as simple as setting up a template that matches <constraintDecl scheme="schematron"> and copies its Schematron children into the output.

@ebeshero ebeshero merged commit ed8db2a into dev Dec 18, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants