Skip to content

Commit

Permalink
Merge pull request #380 from veraPDF/update_error_messages
Browse files Browse the repository at this point in the history
Update PDF/A and PDF/UA error message
  • Loading branch information
MaximPlusov authored Nov 29, 2023
2 parents 785bb9f + 9d8cee5 commit f177a6e
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
the Identification of Languages, as described in PDF Reference 9.8.1</description>
<test>unicodeValue == '' || /^[a-zA-Z]{1,8}(-[a-zA-Z]{1,8})*$/.test(unicodeValue)</test>
<error>
<message>Value %1 of the Lang entry is not Language-Tag</message>
<message>Value %1 of the Lang entry is not a Language-Tag</message>
<arguments>
<argument>unicodeValue</argument>
</arguments>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
as defined in RFC 3066, Tags for the Identification of Languages</description>
<test>unicodeValue == '' || /^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/.test(unicodeValue)</test>
<error>
<message>Value %1 of the Lang entry is not Language-Tag</message>
<message>Value %1 of the Lang entry is not a Language-Tag</message>
<arguments>
<argument>unicodeValue</argument>
</arguments>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<test>Subtype == 'Widget' || Subtype == 'Popup' || Subtype == 'Link' || isOutsideCropBox == true ||
(F &amp; 2) == 2 || structParentStandardType == 'Annot'</test>
<error>
<message>%1 annotation is artifact or is nested within %2 tag (standard type = %3) instead of Annot</message>
<message>%1 annotation is an Artifact or is nested within %2 tag (standard type = %3) instead of Annot</message>
<arguments>
<argument>Subtype</argument>
<argument>structParentType</argument>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<description>Every page on which there is an annotation shall contain in its page dictionary the key Tabs, and its value shall be S</description>
<test>annots_size == 0 || Tabs == 'S'</test>
<error>
<message>A page containing an annotation contains a Tabs key with value %1 instead of S</message>
<message>A page with annotation(s) contains Tabs key with value %1 instead of S</message>
<arguments>
<argument>Tabs</argument>
</arguments>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<description>A Widget annotation shall be nested within a Form tag per ISO 32000-1:2008, 14.8.4.5, Table 340</description>
<test>structParentStandardType == 'Form' || isOutsideCropBox == true || (F &amp; 2) == 2</test>
<error>
<message>A Widget annotation is artifact or is nested within %1 tag (standard type = %2) instead of Form</message>
<message>A Widget annotation is an Artifact or is nested within %1 tag (standard type = %2) instead of Form</message>
<arguments>
<argument>structParentType</argument>
<argument>structParentStandardType</argument>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<description>Links shall be tagged according to ISO 32000-1:2008, 14.8.4.4.2, Link Element</description>
<test>structParentStandardType == 'Link' || isOutsideCropBox == true || (F &amp; 2) == 2</test>
<error>
<message>A Link annotation is artifact or is nested within %1 tag (standard type = %2) instead of Link</message>
<message>A Link annotation is an Artifact or is nested within %1 tag (standard type = %2) instead of Link</message>
<arguments>
<argument>structParentType</argument>
<argument>structParentStandardType</argument>
Expand Down
2 changes: 1 addition & 1 deletion PDF_UA/1/7.2 Text/verapdf-profile-7-2-t29.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
A language identifier shall be a Language-Tag as defined in RFC 3066, Tags for the Identification of Languages</description>
<test>/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/.test(unicodeValue)</test>
<error>
<message>Value %1 of the Lang entry is not Language-Tag</message>
<message>Value %1 of the Lang entry is not a Language-Tag</message>
<arguments>
<argument>unicodeValue</argument>
</arguments>
Expand Down
3 changes: 1 addition & 2 deletions PDF_UA/1/7.5 Tables/verapdf-profile-7-5-t01.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
then structure elements of type TH shall have a Scope attribute</description>
<test>hasConnectedHeader != false || unknownHeaders != ''</test>
<error>
<message>TD does not contain Headers attribute, and Headers for this table cell cannot be determined
via algorithm from ISO 32000-2, 14.8.4.8.3</message>
<message>TD does not contain Headers attribute, and Headers for this table cell cannot be determined algorithmically</message>
<arguments/>
</error>
<references>
Expand Down
3 changes: 1 addition & 2 deletions PDF_UA/1/7.5 Tables/verapdf-profile-7-5-t02.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
then structure elements of type TH shall have a Scope attribute</description>
<test>hasConnectedHeader != false || unknownHeaders == ''</test>
<error>
<message>TD references undefined Header(s) %1, and Headers for this table cell cannot be determined
via algorithm from ISO 32000-2, 14.8.4.8.3</message>
<message>TD references undefined Header(s) %1, and Headers for this table cell cannot be determined algorithmically</message>
<arguments>
<argument>unknownHeaders</argument>
</arguments>
Expand Down
14 changes: 7 additions & 7 deletions PDF_UA/PDFUA-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@
<description>If the Lang entry is present in the document's Catalog dictionary or in a structure element dictionary or property list, its value shall be a language identifier as described in ISO 32000-1:2008, 14.9.2. A language identifier shall be a Language-Tag as defined in RFC 3066, Tags for the Identification of Languages</description>
<test>/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/.test(unicodeValue)</test>
<error>
<message>Value %1 of the Lang entry is not Language-Tag</message>
<message>Value %1 of the Lang entry is not a Language-Tag</message>
<arguments>
<argument>unicodeValue</argument>
</arguments>
Expand Down Expand Up @@ -784,7 +784,7 @@
<description>If the table's structure is not determinable via Headers and IDs, then structure elements of type TH shall have a Scope attribute</description>
<test>hasConnectedHeader != false || unknownHeaders != ''</test>
<error>
<message>TD does not contain Headers attribute, and Headers for this table cell cannot be determined via algorithm from ISO 32000-2, 14.8.4.8.3</message>
<message>TD does not contain Headers attribute, and Headers for this table cell cannot be determined algorithmically</message>
<arguments/>
</error>
<references>
Expand All @@ -796,7 +796,7 @@
<description>If the table's structure is not determinable via Headers and IDs, then structure elements of type TH shall have a Scope attribute</description>
<test>hasConnectedHeader != false || unknownHeaders == ''</test>
<error>
<message>TD references undefined Header(s) %1, and Headers for this table cell cannot be determined via algorithm from ISO 32000-2, 14.8.4.8.3</message>
<message>TD references undefined Header(s) %1, and Headers for this table cell cannot be determined algorithmically</message>
<arguments>
<argument>unknownHeaders</argument>
</arguments>
Expand Down Expand Up @@ -902,7 +902,7 @@
<description>An annotation, excluding annotations of subtype Widget, Popup or Link, shall be nested within an Annot tag</description>
<test>Subtype == 'Widget' || Subtype == 'Popup' || Subtype == 'Link' || isOutsideCropBox == true || (F &amp; 2) == 2 || structParentStandardType == 'Annot'</test>
<error>
<message>%1 annotation is artifact or is nested within %2 tag (standard type = %3) instead of Annot</message>
<message>%1 annotation is an Artifact or is nested within %2 tag (standard type = %3) instead of Annot</message>
<arguments>
<argument>Subtype</argument>
<argument>structParentType</argument>
Expand Down Expand Up @@ -948,7 +948,7 @@
<description>Every page on which there is an annotation shall contain in its page dictionary the key Tabs, and its value shall be S</description>
<test>annots_size == 0 || Tabs == 'S'</test>
<error>
<message>A page containing an annotation contains a Tabs key with value %1 instead of S</message>
<message>A page with annotation(s) contains Tabs key with value %1 instead of S</message>
<arguments>
<argument>Tabs</argument>
</arguments>
Expand All @@ -960,7 +960,7 @@
<description>A Widget annotation shall be nested within a Form tag per ISO 32000-1:2008, 14.8.4.5, Table 340</description>
<test>structParentStandardType == 'Form' || isOutsideCropBox == true || (F &amp; 2) == 2</test>
<error>
<message>A Widget annotation is artifact or is nested within %1 tag (standard type = %2) instead of Form</message>
<message>A Widget annotation is an Artifact or is nested within %1 tag (standard type = %2) instead of Form</message>
<arguments>
<argument>structParentType</argument>
<argument>structParentStandardType</argument>
Expand All @@ -987,7 +987,7 @@
<description>Links shall be tagged according to ISO 32000-1:2008, 14.8.4.4.2, Link Element</description>
<test>structParentStandardType == 'Link' || isOutsideCropBox == true || (F &amp; 2) == 2</test>
<error>
<message>A Link annotation is artifact or is nested within %1 tag (standard type = %2) instead of Link</message>
<message>A Link annotation is an Artifact or is nested within %1 tag (standard type = %2) instead of Link</message>
<arguments>
<argument>structParentType</argument>
<argument>structParentStandardType</argument>
Expand Down
14 changes: 7 additions & 7 deletions PDF_UA/WCAG-21-Complete.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@
<description>If the Lang entry is present in the document's Catalog dictionary or in a structure element dictionary or property list, its value shall be a language identifier as described in ISO 32000-1:2008, 14.9.2. A language identifier shall be a Language-Tag as defined in RFC 3066, Tags for the Identification of Languages</description>
<test>/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/.test(unicodeValue)</test>
<error>
<message>Value %1 of the Lang entry is not Language-Tag</message>
<message>Value %1 of the Lang entry is not a Language-Tag</message>
<arguments>
<argument>unicodeValue</argument>
</arguments>
Expand Down Expand Up @@ -1582,7 +1582,7 @@
<description>If the table's structure is not determinable via Headers and IDs, then structure elements of type TH shall have a Scope attribute</description>
<test>hasConnectedHeader != false || unknownHeaders != ''</test>
<error>
<message>TD does not contain Headers attribute, and Headers for this table cell cannot be determined via algorithm from ISO 32000-2, 14.8.4.8.3</message>
<message>TD does not contain Headers attribute, and Headers for this table cell cannot be determined algorithmically</message>
<arguments/>
</error>
<references>
Expand All @@ -1594,7 +1594,7 @@
<description>If the table's structure is not determinable via Headers and IDs, then structure elements of type TH shall have a Scope attribute</description>
<test>hasConnectedHeader != false || unknownHeaders == ''</test>
<error>
<message>TD references undefined Header(s) %1, and Headers for this table cell cannot be determined via algorithm from ISO 32000-2, 14.8.4.8.3</message>
<message>TD references undefined Header(s) %1, and Headers for this table cell cannot be determined algorithmically</message>
<arguments>
<argument>unknownHeaders</argument>
</arguments>
Expand Down Expand Up @@ -1700,7 +1700,7 @@
<description>An annotation, excluding annotations of subtype Widget, Popup or Link, shall be nested within an Annot tag</description>
<test>Subtype == 'Widget' || Subtype == 'Popup' || Subtype == 'Link' || isOutsideCropBox == true || (F &amp; 2) == 2 || structParentStandardType == 'Annot'</test>
<error>
<message>%1 annotation is artifact or is nested within %2 tag (standard type = %3) instead of Annot</message>
<message>%1 annotation is an Artifact or is nested within %2 tag (standard type = %3) instead of Annot</message>
<arguments>
<argument>Subtype</argument>
<argument>structParentType</argument>
Expand Down Expand Up @@ -1746,7 +1746,7 @@
<description>Every page on which there is an annotation shall contain in its page dictionary the key Tabs, and its value shall be S</description>
<test>annots_size == 0 || Tabs == 'S'</test>
<error>
<message>A page containing an annotation contains a Tabs key with value %1 instead of S</message>
<message>A page with annotation(s) contains Tabs key with value %1 instead of S</message>
<arguments>
<argument>Tabs</argument>
</arguments>
Expand All @@ -1758,7 +1758,7 @@
<description>A Widget annotation shall be nested within a Form tag per ISO 32000-1:2008, 14.8.4.5, Table 340</description>
<test>structParentStandardType == 'Form' || isOutsideCropBox == true || (F &amp; 2) == 2</test>
<error>
<message>A Widget annotation is artifact or is nested within %1 tag (standard type = %2) instead of Form</message>
<message>A Widget annotation is an Artifact or is nested within %1 tag (standard type = %2) instead of Form</message>
<arguments>
<argument>structParentType</argument>
<argument>structParentStandardType</argument>
Expand Down Expand Up @@ -1786,7 +1786,7 @@
<test>structParentStandardType == 'Link' || structParentStandardType == 'Reference' ||
isOutsideCropBox == true || (F &amp; 2) == 2</test>
<error>
<message>A Link annotation is artifact or is nested within %1 tag (standard type = %2) instead of Link or Reference</message>
<message>A Link annotation is an Artifact or is nested within %1 tag (standard type = %2) instead of Link or Reference</message>
<arguments>
<argument>structParentType</argument>
<argument>structParentStandardType</argument>
Expand Down

0 comments on commit f177a6e

Please sign in to comment.