JATS-0025-002

Rule Overview

Message

xml:lang or hreflang attribute "$languageCodeError" should contain a valid language code (using the shortest ISO 639), potentially followed by a script code and region code

Rule XPath:

This rule ASSERTS the following, raising an alert if FALSE:

let $languageCodeError := (@xml:lang | @hreflang)[not(matches(., '^[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*$') and (tokenize(., '-')[1] = $langauge-codes//language/@code))] returnempty($languageCodeError)

Contexts

Inherited Contexts