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

exact string matching #494

Merged
merged 1 commit into from
Nov 26, 2024
Merged

Conversation

clapierre
Copy link
Collaborator

now making sure the exact strings for conformance are checked

now making sure the exact strings for conformance are checked
@clapierre
Copy link
Collaborator Author

This addresses the following conformance matching string issue brought up by @wareid in issue
#471 Editorial Feedback for the ONIX/EPUB Techniques Document

@GeorgeKerscher
Copy link
Collaborator

It looks good to me, but I would like to have others review.

@mattgarrish
Copy link
Member

mattgarrish commented Nov 26, 2024

Do we really need to set all these variables? From what I can tell, only the conformance string to display and the wcag level matter in terms of setting statements in the following section.

For example, all of the 1.1 matching strings could be reduced to something like:

IF the result of calling check for node on package_document, /package/metadata/meta[@property="dcterms:conformsTo" and matches(normalize-space(.), 'EPUB Accessibility 1\.1 - WCAG 2\.[0-2] Level [A]+') :

THEN LET conformance_str = replace(normalize-space(.), ' - ', ''),
and LET wcag_level = replace(normalize-space(.), 'EPUB Accessibility 1\.1 - WCAG 2\.[0-2] Level ', '').

(I don't know if we'd really want to use xslt syntax for setting the variables, but it's just to give an idea that you can process the existing string to get the same value you generate below.)

In any case, if conformance_str is not an empty string, then you'd know you can continue to display conformance information. You'd still use the wcag_level to give the generic statement and conformance_str would contain the specific information rather than having to rebuild almost exactly the same string you just decomposed.

The conformance statement would presumably still be translatable; it would just require an extra step to match the English string that results after removing the dash into whatever the equivalent translation would be (i.e., you wouldn't show every possibility in the techniques document, but maybe note that the value could translate to one of 9 possible permutations of 1.1 identifiers).

@clapierre
Copy link
Collaborator Author

@gregoriopellegrino what do you think about @mattgarrish suggestion?
I don't know how I would write it up since the only variable set is the WCAG level and how it would work in the Instructions portion without the other variables being set. I am sure there is a more elegant way to do this but I haven't the time to figure that out.

@mattgarrish
Copy link
Member

I can open a new PR based on this one to give a better idea of how it might work. I assume this processing is based on the onix metadata, but in that case the information comes decomposed and has to be built up. For the conformsTo string, it seems like a lot of unnecessary work to break it all apart just to put it back together.

@clapierre clapierre merged commit e5ad7ba into main Nov 26, 2024
@clapierre clapierre deleted the EPUB-Techniques-Conformance-String-Matching branch November 26, 2024 15:36
@clapierre
Copy link
Collaborator Author

Sounds good Matt, I think I see where you are coming from, maybe I just need more coffee. Appreciate the help.

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

Successfully merging this pull request may close these issues.

4 participants