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

fix: harmonize quotes usage in messages #1132

Merged
merged 4 commits into from
Apr 29, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
332 changes: 166 additions & 166 deletions src/main/resources/com/adobe/epubcheck/messages/MessageBundle.properties

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<let name="id-set" value="//*[@id]"/>
<rule context="*[@id]">
<assert test="count($id-set[normalize-space(@id) = normalize-space(current()/@id)]) = 1"
>Duplicate '<value-of select="normalize-space(current()/@id)"/>'</assert>
>Duplicate "<value-of select="normalize-space(current()/@id)"/>"</assert>
</rule>
</pattern>
</schema>
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
count(//opf:reference[
normalize-space(lower-case(@type)) = $current_type_normalized and
normalize-space(lower-case(@href)) = $current_href_normalized
]) le 1">WARNING: Duplicate 'reference' elements with the same 'type' and 'href' attributes</sch:assert>
]) le 1">WARNING: Duplicate "reference" elements with the same "type" and "href" attributes</sch:assert>
</sch:rule>
</sch:pattern>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<sch:pattern name="nested_hyperlinks">
<sch:rule context="h:a">
<sch:report test="descendant::h:a">The a element cannot contain any nested a
<sch:report test="descendant::h:a">The "a" element cannot contain any nested "a"
elements.</sch:report>
</sch:rule>
</sch:pattern>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

<pattern>
<rule context="h:nav[empty(ancestor::h:nav)]">
<assert test="normalize-space(@epub:type)">A 'nav' element in a Data Navigation Document
must have an 'epub:type' attribute (to identify the nature of the navigation
<assert test="normalize-space(@epub:type)">A "nav" element in a Data Navigation Document
must have an "epub:type" attribute (to identify the nature of the navigation
component it contains).</assert>
</rule>
</pattern>
Expand All @@ -21,19 +21,19 @@
<pattern>
<rule context="h:nav[tokenize(@epub:type, '\s+') = 'region-based']//h:li">
<assert test="h:*[1]/(self::h:a | self::h:span)">The first child of a region-based nav
list item must be either an 'a' or 'span' element.</assert>
list item must be either an "a" or "span" element.</assert>
<assert test="if (count(h:*) > 1) then count(h:*) = 2 and h:*[2]/self::h:ol else true()">The first child of
a region-based nav list item can only be followed by a single 'ol' element.</assert>
a region-based nav list item can only be followed by a single "ol" element.</assert>
</rule>
</pattern>
<pattern>
<rule context="h:nav[tokenize(@epub:type, '\s+') = 'region-based']//h:a">
<assert test="normalize-space(.)=''">WARNING: 'a' elements in region-based navs should not contain text labels.</assert>
<assert test="normalize-space(.)=''">WARNING: "a" elements in region-based navs should not contain text labels.</assert>
</rule>
</pattern>
<pattern>
<rule context="h:nav[tokenize(@epub:type, '\s+') = 'region-based']//h:span">
<assert test="count(h:*)=2 and count(h:a) = 2">'span'elements in region-base navs must contain exactly two 'a' elements.</assert>
<assert test="count(h:*)=2 and count(h:a) = 2">"span" elements in region-base navs must contain exactly two "a" elements.</assert>
</rule>
</pattern>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
test="
exists(/opf:package/opf:metadata/opf:meta[normalize-space(@property) = 'source-language']
| opf:metadata/opf:meta[normalize-space(@property) = 'source-language'])"
>An EPUB Dictionary must declare its source language using a 'source-language'
>An EPUB Dictionary must declare its source language using a "source-language"
metadata.</assert>
<assert
test="
exists(/opf:package/opf:metadata/opf:meta[normalize-space(@property) = 'target-language']
| opf:metadata/opf:meta[normalize-space(@property) = 'target-language'])"
>An EPUB Dictionary must declare its source language using a 'target-language'
>An EPUB Dictionary must declare its source language using a "target-language"
metadata.</assert>
<report
test="count(opf:metadata/opf:meta[normalize-space(@property)='source-language'])>1"
Expand Down
20 changes: 10 additions & 10 deletions src/main/resources/com/adobe/epubcheck/schema/30/dict/dict-opf.sch
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<pattern id="dict.dctype">
<rule context="/opf:package/opf:metadata">
<assert test="child::dc:type[normalize-space(.) = 'dictionary']">The dc:type identifier
'dictionary' is required.</assert>
"dictionary" is required.</assert>
</rule>
</pattern>

Expand All @@ -22,18 +22,18 @@
]) = 1"
>An EPUB Publication consisting of a single EPUB Dictionary must contain exactly one
Search Key Map document for this dictionary (i.e. exactly one item with properties
'search-key-map' and 'dictionary').</assert>
"search-key-map" and "dictionary").</assert>
</rule>
</pattern>
<pattern id="dict.single-dict.lang">
<rule context="opf:package[empty(opf:collection[tokenize(@role, '\s+') = 'dictionary'])]">
<assert
test="exists(opf:metadata/opf:meta[normalize-space(@property) = 'source-language'])"
>An EPUB Dictionary must declare its source language using a 'source-language'
>An EPUB Dictionary must declare its source language using a "source-language"
metadata.</assert>
<assert
test="exists(opf:metadata/opf:meta[normalize-space(@property) = 'target-language'])"
>An EPUB Dictionary must declare its source language using a 'target-language'
>An EPUB Dictionary must declare its source language using a "target-language"
metadata.</assert>
<report
test="count(opf:metadata/opf:meta[normalize-space(@property)='source-language'])>1"
Expand All @@ -46,7 +46,7 @@
<report
test="count(/opf:package/opf:collection[tokenize(@role,'\s+')='dictionary']
/opf:link[normalize-space(@href)=$skm]) > 1"
>Search Key Map Document '<value-of select="$skm"/>' is referenced in more than one
>Search Key Map Document "<value-of select="$skm"/>" is referenced in more than one
dictionary collection.</report>
</rule>
</pattern>
Expand All @@ -57,8 +57,8 @@
'target-language')]">
<let name="lang" value="normalize-space(.)"/>
<assert test="exists(/opf:package/opf:metadata/dc:language[normalize-space(.) = $lang])"
>EPUB Dictionaries 'source-language' and 'target-language' must also be declared as
'dc:language' in package-level metadata.</assert>
>EPUB Dictionaries "source-language" and "target-language" must also be declared as
"dc:language" in package-level metadata.</assert>
</rule>
</pattern>
<pattern id="dict.type">
Expand All @@ -74,9 +74,9 @@
'spelling',
'pronouncing',
'etymological')"
>EPUB Dictionaries 'dictionary-type' metadata must be one of 'monolingual',
'bilingual', 'multilingual', 'thesaurus', 'encyclopedia', 'spelling', 'pronouncing',
or 'etymological'.</assert>
>EPUB Dictionaries "dictionary-type" metadata must be one of "monolingual",
"bilingual", "multilingual", "thesaurus", "encyclopedia", "spelling", "pronouncing",
or "etymological".</assert>
</rule>
</pattern>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,39 @@

<pattern id="dictionary">
<rule context="h:*[tokenize(@epub:type,'\s+')='dictionary']">
<assert test="self::h:body|self::h:section">The 'dictionary' type is only allowed on 'body' or
'section' elements.</assert>
<assert test="exists(h:article)">A 'dictionary' must have at least one article child.</assert>
<assert test="self::h:body|self::h:section">The "dictionary" type is only allowed on "body" or
"section" elements.</assert>
<assert test="exists(h:article)">A "dictionary" must have at least one article child.</assert>
</rule>
</pattern>

<pattern id="dictionary-entry">
<rule
context="h:*[tokenize(@epub:type,'\s+')='dictionary']/h:article | h:*[tokenize(@epub:type,'\s+')='dictentry']">
<assert test="self::h:article">The 'dictentry' type is only allowed on 'article'
<assert test="self::h:article">The "dictentry" type is only allowed on "article"
elements.</assert>
<assert
test="exists(.//h:dfn except .//h:dfn[ancestor::h:*[tokenize(@epub:type,'\s+')='condensed-entry']])"
>A dictionary entry must have at least one 'dfn' descendant (outside of the optional
condensed entry 'aside').</assert>
>A dictionary entry must have at least one "dfn" descendant (outside of the optional
condensed entry "aside").</assert>
</rule>
</pattern>

<pattern id="condensed-entry">
<rule context="h:*[tokenize(@epub:type,'\s+')='condensed-entry']">
<assert test="self::h:aside">The 'condensed-entry' type is only allowed on 'aside'
<assert test="self::h:aside">The "condensed-entry" type is only allowed on "aside"
elements.</assert>
<assert test="parent::h:article[parent::h:*[tokenize(@epub:type,'\s+')='dictionary']]">The
'condensed-entry' type is only allowed on a child element of an 'article' dictionary
"condensed-entry" type is only allowed on a child element of an "article" dictionary
entry.</assert>
<assert test="exists(@hidden[lower-case(.)=('','hidden')])">A 'condensed-entry' must have a
'hidden' attribute with its value set to 'hidden' or the empty string.</assert>
<assert test="exists(@hidden[lower-case(.)=('','hidden')])">A "condensed-entry" must have a
"hidden" attribute with its value set to "hidden" or the empty string.</assert>
</rule>
</pattern>

<pattern id="part-of-speech-list">
<rule context="h:*[tokenize(@epub:type,'\s+')='part-of-speech-list']">
<assert test="self::h:ol">The 'part-of-speech-list' type is only allowed on 'ol'
<assert test="self::h:ol">The "part-of-speech-list" type is only allowed on "ol"
elements.</assert>
</rule>
</pattern>
Expand All @@ -55,41 +55,41 @@
<let name="semchilds"
value="descendant::h:*[ancestor::h:*[@epub:type or self::h:li][1] is current()]"/>
<assert test="exists($semchilds[tokenize(@epub:type,'\s+')='part-of-speech'])">A
'part-of-speech-group' must contain an element of type 'part-of-speech'.</assert>
"part-of-speech-group" must contain an element of type "part-of-speech".</assert>
</rule>
</pattern>

<pattern id="sense-list">
<rule context="h:*[tokenize(@epub:type,'\s+')='sense-list']">
<assert test="self::h:ol">The 'sense-list' type is only allowed on 'ol' elements.</assert>
<assert test="self::h:ol">The "sense-list" type is only allowed on "ol" elements.</assert>
</rule>
</pattern>

<pattern id="tran-info">
<rule context="h:*[tokenize(@epub:type,'\s+')='tran-info']">
<assert test="exists(../h:*[tokenize(@epub:type,'\s+')='tran'])">An element of type
'tran-info' must have a sibling element of type 'tran'.</assert>
"tran-info" must have a sibling element of type "tran".</assert>
</rule>
</pattern>

<pattern id="idiom">
<rule context="h:*[tokenize(@epub:type,'\s+')='idiom']">
<assert test="self::h:dfn">The 'idiom' type is only allowed on 'dfn' elements.</assert>
<assert test="self::h:dfn">The "idiom" type is only allowed on "dfn" elements.</assert>
</rule>
</pattern>

<pattern id="phrase-list">
<rule context="h:*[tokenize(@epub:type,'\s+')='phrase-list']">
<assert test="self::h:ol | self::h:ul">The 'phrase-list' type is only allowed on 'ol' or 'ul'
<assert test="self::h:ol | self::h:ul">The "phrase-list" type is only allowed on "ol" or "ul"
elements.</assert>
</rule>
</pattern>

<pattern id="phrase-group">
<rule
context="h:*[tokenize(@epub:type,'\s+')='phrase-group'] | h:*[tokenize(@epub:type,'\s+')='phrase-list']/h:li">
<assert test="exists(.//h:*[tokenize(@epub:type,'\s+')=('example','idiom')])">A 'phrase-group'
must contain an element of type 'idiom' or 'example'.</assert>
<assert test="exists(.//h:*[tokenize(@epub:type,'\s+')=('example','idiom')])">A "phrase-group"
must contain an element of type "idiom" or "example".</assert>
</rule>
</pattern>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<pattern id="dc.type">
<rule context="ocf:metadata">
<assert test="dc:type[normalize-space(.)='edupub']">A dc:type element with the value 'edupub' is required.</assert>
<assert test="dc:type[normalize-space(.)='edupub']">A dc:type element with the value "edupub" is required.</assert>
</rule>
</pattern>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<pattern id="edu.dctype">
<rule context="opf:metadata">
<assert test="child::dc:type[normalize-space(.)='edupub']">The dc:type identifier 'edupub' is required.</assert>
<assert test="child::dc:type[normalize-space(.)='edupub']">The dc:type identifier "edupub" is required.</assert>
</rule>
</pattern>

Expand All @@ -16,14 +16,14 @@
<assert test="child::opf:meta[normalize-space(@property)='schema:accessibilityFeature']">At least one
schema:accessibilityFeature declaration is required.</assert>
<report test="child::opf:meta[normalize-space(@property)='schema:accessibilityFeature'][normalize-space(.)='none']">The
schema:accessibilityFeature property value 'none' is not valid in edupub. Use 'tableOfContents'
schema:accessibilityFeature property value "none" is not valid in edupub. Use "tableOfContents"
if no other values are applicable.</report>
</rule>
</pattern>

<pattern id="edu.teacher.edition">
<rule context="dc:type[normalize-space(.)='teacher-edition']">
<report test="parent::opf:metadata/not(child::dc:source)">WARNING: A teacher's edition
<report test="parent::opf:metadata/not(child::dc:source)">WARNING: A teachers edition
should identify the corresponding student edition in a dc:source element.</report>
</rule>
</pattern>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

<report test="count($headings) = 1 and string-length(normalize-space(concat($headings,$headings/html:img/@alt,$headings//@aria-label))) = 0">Empty ranked heading detected.</report>

<report test="@aria-label and (normalize-space($headings) = normalize-space(@aria-label))">The value of the 'aria-label' attribute must not be the same as the content of the heading.</report>
<report test="@aria-label and (normalize-space($headings) = normalize-space(@aria-label))">The value of the "aria-label" attribute must not be the same as the content of the heading.</report>
</rule>


Expand All @@ -55,7 +55,7 @@

<report test="count($headings) = 1 and string-length(normalize-space(concat($headings,$headings/html:img/@alt,$headings//@aria-label))) = 0">Empty ranked heading detected.</report>

<report test="@aria-label and (normalize-space($headings) = normalize-space(@aria-label))">The value of the 'aria-label' attribute must not be the same as the content of the heading.</report>
<report test="@aria-label and (normalize-space($headings) = normalize-space(@aria-label))">The value of the "aria-label" attribute must not be the same as the content of the heading.</report>
</rule>

<rule context="html:h1|html:h2|html:h3|html:h4|html:h5|html:h6">
Expand Down
12 changes: 6 additions & 6 deletions src/main/resources/com/adobe/epubcheck/schema/30/epub-nav-30.sch
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

<pattern id="nav-ocurrence">
<rule context="html:body">
<assert test="count(.//html:nav[tokenize(@epub:type,'\s+')='toc']) = 1">Exactly one 'toc' nav element
<assert test="count(.//html:nav[tokenize(@epub:type,'\s+')='toc']) = 1">Exactly one "toc" nav element
must be present</assert>
<assert test="count(.//html:nav[tokenize(@epub:type,'\s+')='page-list']) &lt; 2">Multiple occurrences of
the 'page-list' nav element</assert>
the "page-list" nav element</assert>
<assert test="count(.//html:nav[tokenize(@epub:type,'\s+')='landmarks']) &lt; 2">Multiple occurrences of
the 'landmarks' nav element</assert>
the "landmarks" nav element</assert>
</rule>
</pattern>

Expand All @@ -28,7 +28,7 @@
<let name="current_href_normalized" value="normalize-space(lower-case(@href))"/>

<!-- Check for missing epub:type attributes -->
<assert test="@epub:type">Missing epub:type attribute on anchor inside 'landmarks' nav element</assert>
<assert test="@epub:type">Missing epub:type attribute on anchor inside "landmarks" nav element</assert>

<!--
landmarks anchors should be unique (#493)
Expand All @@ -38,7 +38,7 @@
count(ancestor::html:nav//html:ol//html:a[
tokenize(lower-case(@epub:type),'\s+') = $current_type_normalized and
normalize-space(lower-case(@href)) = $current_href_normalized
]) le 1">Another landmark was found with the same epub:type and same reference to '<value-of select="$current_href_normalized"/>'</assert>
]) le 1">Another landmark was found with the same epub:type and same reference to "<value-of select="$current_href_normalized"/>"</assert>
</rule>
</pattern>

Expand All @@ -62,7 +62,7 @@
<rule
context="html:nav[@epub:type][not(tokenize(@epub:type,'\s+') = ('toc','page-list','landmarks'))]">
<assert test="child::*[1][self::html:h1|self::html:h2|self::html:h3|self::html:h4|self::html:h5|self::html:h6]">nav
elements other than 'toc', 'page-list' and 'landmarks' must have a heading as their
elements other than "toc", "page-list" and "landmarks" must have a heading as their
first child</assert>
</rule>
</pattern>
Expand Down
Loading