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

Allow arbitrary order of header elements. #536

Open
kalaspuffar opened this issue Dec 13, 2022 · 7 comments
Open

Allow arbitrary order of header elements. #536

kalaspuffar opened this issue Dec 13, 2022 · 7 comments

Comments

@kalaspuffar
Copy link
Collaborator

Hinderburg creates epubs that have an order for the elements that is not allowed.

 <head>
    <meta charset="UTF-8" />
    <title>Bibliotekariestereotypen i populärkulturen</title>
    <meta name="dc:title" content="Bibliotekariestereotypen i populärkulturen" />
    <meta name="dc:creator" content="Richard Ohlsson" />
    <meta name="dc:identifier" content="V002631" />
    <meta name="dc:format" content="ePub 3.0" />
    <meta name="dc:publisher" content="MTM" />
    <meta name="ncc:generator" content="Narrator Studio 1.50.2450" />
    <meta name="viewport" content="width=device-width" />
    <link rel="stylesheet" type="text/css" href="style.css" />
  </head>

The order in the beginning of the file should be:

    <meta charset="UTF-8" />
    <title>Bibliotekariestereotypen i populärkulturen</title>
    <meta name="dc:identifier" content="V002631" />
    <meta name="viewport" content="width=device-width" />

After that, we allow any or none of the meta or style link items.

The problem is that we can't interleave elements using RNG if they are the same element. So we can't interleave 3 meta elements as they aren't unique.

@kalaspuffar
Copy link
Collaborator Author

Hi @josteinaj

How do we handle this? Remove the RNG validation and rewrite it in Schematron?

Or do you have a better solution here?

Best regards
Daniel

@josteinaj
Copy link
Member

Could it be done with a <choice> in RNG?

@josteinaj
Copy link
Member

Also, is this the 2015-1 guidelines?

@kalaspuffar
Copy link
Collaborator Author

Hi @josteinaj

I'm not sure if we can do it with choice. Then you need to say choose any of these and we need 4 of them. But we could have duplicates and then one could be missing.

Best regards
Daniel

@kalaspuffar
Copy link
Collaborator Author

Also, is this the 2015-1 guidelines?

No clue what Hindenburg creates, never worked with it.

@josteinaj
Copy link
Member

josteinaj commented Dec 16, 2022

Ok. I haven't actually used Hindenburg myself, but as far as I know: Hindenburg does as little as possible to the EPUB. So the EPUB you put in, will be the EPUB you get out, except for the additon of media overlay and some other changes. I don't think it forces the output into the nordic markup guidelines.

Rewriting the requirement to Schematron seems sensible. I compared the 2015-1 and 2020-1 guidelines now. The 2015-1 guidelines say that charset, title, dc:identifier and viewport must occur as the four first children in that specific order. But the 2020-1 guidelines only requires dc:identifier and viewport, and they have no positional requirement.

So yes, for the 2020-1 validation you can rewrite the checks for dc:identifier and viewport as schematron rules. The 2015-1 validation you can leave as-is.

@oscarlcarlsson
Copy link
Collaborator

The files we have used for these validation checks have all been with the 2020-1 guidelines.

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

No branches or pull requests

3 participants