Skip to content

Redundant error messages invite glazed eyes #7

@tgraham-antenna

Description

@tgraham-antenna

Sorry to sound like the clue for a cryptic crossword, but the repetition of error messages and error categories makes it easy for a user to skim over the report details and so not notice the actual differences.

XVRL documents might not be meant for human consumption, but some humans will end up reading them from time to time.

xvrl/sample/sample1.xml

Lines 19 to 27 in 88f45b7

<report severity="error" code="fake-smallcaps">
<location xpath="/foo/bar[1]/test[2]" line="12" column="24"/>
<category vocabulary="typesetter-friendly" xml:lang="en">Typography</category>
<category vocabulary="typesetter-friendly" xml:lang="fr">Typographie</category>
<category vocabulary="programmer-friendly" xml:lang="en">ignorable</category>
<category vocabulary="programmer-friendly" xml:lang="fr">ignorable</category>
<message xml:lang="en">Don’t use font-size and all-capital letters to emulate small caps</message>
<message xml:lang="fr">Veuillez utiliser des petites capitales propres svp</message>
</report>

( I resent the implication that programmers may ignore typographic errors!)

xvrl/sample/sample1.xml

Lines 34 to 43 in 88f45b7

<report severity="error" code="invalid_attribute_value">
<location xpath="/foo/bar[1]/test[2]" line="8" column="20"/>
<message xml:lang="en">value of attribute "test" is invalid; must be equal to "xxx" or "yyy"</message>
<message xml:lang="fr">La valeur de l'attribut "test" est invalide ; doit être égale à "xxx" ou "yyy"</message>
</report>
<report severity="error" code="invalid_attribute_value">
<location xpath="/foo/bar[1]/test[3]" line="16" column="12"/>
<message xml:lang="en">value of attribute "test" is invalid; must be equal to "xxx" or "yyy"</message>
<message xml:lang="fr">La valeur de l'attribut "test" est invalide ; doit être égale à "xxx" ou "yyy"</message>
</report>

There is currently a template mechanism for individual report elements:

xvrl/sample/sample1.xml

Lines 63 to 68 in 88f45b7

<let name="target" value="100"/>
<message xml:lang="en" template="true">The sum of these column values
should be equal <value name="$target"/>.</message>
<message xml:lang="fr" template="true">La somme des valeurs de cette
colonnes devrait être égale à <value name="$target"/>.</message>
<supplemental></supplemental>

The least-worst solution that I can think of would be to generalise the template mechanism such that the templates may be grouped at the validation-reports and/or validation-report level so that the report element may contain just the error code and the parameter values specific to that error.

Yes, it would be a bit like putting parameterized Schematron diagnostics elements at the start (or end) of the report from which (please, please) you select only the message in the best-matching of the available translations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions