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

Validate <meta> metadata #107

Open
tomschr opened this issue Dec 1, 2022 · 2 comments
Open

Validate <meta> metadata #107

tomschr opened this issue Dec 1, 2022 · 2 comments
Assignees
Labels
geekodoc 2️⃣ For GeekoDoc version2 only

Comments

@tomschr
Copy link
Contributor

tomschr commented Dec 1, 2022

Problem Description

We introduced metadata which is added as the <meta> element. However, these tags aren't validated nor does it guide XML editors.

Expected Behaviour

Make GeekoDoc v2 aware of the respective tags. If feasible, add also limitations to the respective <meta> element.

Related information

@tomschr tomschr added the geekodoc 2️⃣ For GeekoDoc version2 only label Dec 1, 2022
@tomschr tomschr self-assigned this Dec 1, 2022
@tomschr
Copy link
Contributor Author

tomschr commented Dec 1, 2022

I've tested a minimal example:

default namespace db = "http://docbook.org/ns/docbook"
datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"
datatypes dtd = "http://relaxng.org/ns/compatibility/datatypes/1.0"

include "docbook.rnc" {}

div{
  db.meta.title.attlist =
      attribute name {
        ## A title for SEO (max 55 characters)
        "title"
        }
      & db.meta.role.attribute?
      & db.common.attributes
      & db.common.linking.attributes

  db.meta.title =
      ## A title for SEO (max 55 characters)
      element meta {
         db.meta.title.attlist,
         xsd:token { maxLength = "55" }
      }

  db.meta.description.attlist =
      attribute name {
        ## A short SEO description, max. 150 chars
        "description"
      }
      & db.meta.role.attribute?
      & db.common.attributes
      & db.common.linking.attributes

  db.meta.description =
      ## A short SEO description, max. 150 chars
      element meta {
        db.meta.description.attlist,
        xsd:token { maxLength = "150" }
      }
}

db.meta |= (db.meta.title | db.meta.description )

However, jing seems not to check the length of an element like:

<!-- 60 characters: should be invalid -->
<meta name="title">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</meta>

<!-- 10 characters: should be valid -->
<meta name="title">xxxxxxxxxx</meta>

Both are correct for jing. 😞


Jing version: 20151127 and 20220510 (both fail)
OS: openSUSE Leap 15.4

@tomschr
Copy link
Contributor Author

tomschr commented Dec 8, 2022

Write to the DocBook mailinglist.

tomschr added a commit that referenced this issue Jan 13, 2023
Implemented as Schematron schema
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
geekodoc 2️⃣ For GeekoDoc version2 only
Projects
None yet
Development

No branches or pull requests

1 participant