Skip to content

Validator API returns incorrect line counts for schema and ruleset violations if file uses old Mac-style CR only line endings #550

Open
@simon-20

Description

@simon-20

Brief Description
Validator API will return incorrect line counts for schema and ruleset violations if file uses old Mac-style CR only line endings.

The Validator has to manually count lines for violation reporting because it splits up IATI XML activity files by activity, generating a new XML DOM object for each. The code which counts lines just counts LR characters; it is here:

idx = oneIatiActivity.indexOf(10, idx + 1);

This means line counts will be inaccurate if the file uses any single CR as line endings.

Severity
Low

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