-
Notifications
You must be signed in to change notification settings - Fork 87
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
Implement @hcayless solution #1 for issue @2246 — do not test @spanTo
across files
#2662
Implement @hcayless solution #1 for issue @2246 — do not test @spanTo
across files
#2662
Conversation
update tests to match.
@spanTo
across files@spanTo
across files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go as far as I can see.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just pulled in this branch, ran tests and built exemplars so I could see the built RelaxNG. I tested that new version against a local TEI file with a @spanTo
that points into external file rather than to a following anchor, and all works as expected. The new version successfully loosens the constraint so we can do this without a validation error. And the new version of the Schematron also works to validate a pointer to a following anchor inside the file. So all's good!
With two positive reviews and a refridge period beginning, I'm just going ahead and merging this now to dev. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sydb It's not perfect, but I'll point out that the previous rule also assumed a plain fragment identifier. Approved.
Since no one has discussed this further in over 2 years, I just went ahead and changed the Schematron (as proposed on the issue) to only test that the target element follows the current element iff the
@spanTo
starts with ‘#’. I used (what I think) is an easier-to-understand XPath, though.This is not an ideal solution, of course, because (IMHO) we should allow a user to put whitespace in the attr value and still get the test (i.e., we should use normalize-space() in the code). Also, doesn’t
.#duck
also point to the element with ID "duck"? For that matter, doesn’t../me.xml#duck
point to it if the current file happens to be called me.xml?