Bug #6086
closed![Author: Martin Honnen](https://www.gravatar.com/avatar/3ea75023c3c487f36257090d420b7c50?rating=PG&size=50&default=https%3A%2F%2Fassets.plan.io%2Fimages%2Fdefault_avatar.png)
![Assignee: Michael Kay](https://www.gravatar.com/avatar/db6526d63053f09b62e52c2da8b2230a?rating=PG&size=22&default=https%3A%2F%2Fassets.plan.io%2Fimages%2Fdefault_avatar.png)
Is the schema validation-reports.xsd up to date?
100%
Description
The documentation at https://www.saxonica.com/html/documentation12/schema-processing/commandline.html says:
-report:filename
This option switches on the capture of validation reporting. Here filename specifies where the validation report should be written to on disk. The validation report is in XML format. The format of the validation report is defined in a schema which is available in the saxon-resources download file (see validation-reports.xsd).
However, the schema I find in the Saxon 12 resources download has <xs:attribute name="path" use="optional" type="xs:anyURI">
and the XPath Saxon outputs is neither by Xerces nor by Saxon itself considered as a valid xs:anyURI
value.
Furthermore, there is an annotation
<xs:attribute name="column" use="optional" type="xs:integer">
<xs:annotation>
<xs:documentation>Defines the column number where the error occurs.
This attribute and the path attribute are mutually exclusive.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="path" use="optional" type="xs:anyURI">
<xs:annotation>
<xs:documentation>Defines the path where the error occurs if the column number is unavailable.
This attribute and the path attribute are mutually exclusive.</xs:documentation>
</xs:annotation>
</xs:attribute>
but I see column
and path
in validation reports.
Updated by Michael Kay about 1 year ago
Indeed you are right, the schema is not up to date.
Most notably, the <error>
element may now contain, as well as the error message text, a sequence of <contributing-node>
elements giving details of nodes contributing to the error, used in particular for xs:assert failures.
Updated by Michael Kay about 1 year ago
- Tracker changed from Support to Bug
- Category changed from Command Line to Diagnostics
- Status changed from New to Resolved
- Assignee set to Michael Kay
- Applies to branch 11, 12, trunk added
- Fix Committed on Branch 11, 12, trunk added
Updated by O'Neil Delpratt about 1 year ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 12.3 added
Bug fix applied in the Saxon 12.3 maintenance release.
Updated by O'Neil Delpratt about 1 year ago
- Status changed from Closed to Resolved
Leaving this bug issue as resolved until resolved against Saxon 11.
Updated by Debbie Lockett about 1 year ago
- Status changed from Resolved to Closed
- Fixed in Maintenance Release 11.6 added
Bug fix applied in the Saxon 11.6 maintenance release.
Updated by Debbie Lockett 9 months ago
- Status changed from Closed to In Progress
I'm reopening this bug, as it appears that there is more to do. Validation reports from successful validations are not valid against the schema validation-reports.xsd.
e.g. the validation report produced when validating books.xml against books.xsd (in the samples in the saxon-resources download) looks like:
<validation-report xmlns="http://saxon.sf.net/ns/validation"
system-id="file:/Users/BLAH/data/books.xml">
<meta-data>
<validator name="SAXON-EE" version="12.4"/>
<results errors="0" warnings="0"/>
<schema file="data/books.xsd" xsd-version="1.1"/>
<run at="2023-11-30T17:50:35.465518Z"/>
</meta-data>
</validation-report>
but validating that against validation-reports.xsd results in:
Validation error on line 4 column 15 of report_Validate_1.xml:
FORG0001: In content of element <validation-report>: The content model does not allow
element <meta-data> to appear as the first child. It must be preceded by <Q{.../validation}error>.
See https://www.w3.org/TR/xmlschema11-1/#cvc-complex-type clause 2.4
Validation complete: errors found
Discovered because I am (belatedly) adding tests of validation-reports.xsd in run-samples.gradle.
Updated by Debbie Lockett 9 months ago
Tests added for the validation-reports.xsd schema in run-samples.gradle.
run_cmd_books_sample_tests
now includes tasks (validate_report_Validate_1
and validate_report_Validate_2
) which test the validation reports from validating the samples books.xml and books-invalid.xml, against books.xsd, respectively.
Also run_config_tests
now includes tasks which test that the validation reports from validating (generated) configuration files against the schema are valid.
The tests (apart from validate_report_Validate_2
) currently fail due to the bug noted in #note-6.
Committed on saxon12 and main branches.
Updated by Debbie Lockett 9 months ago
Books validation reports tests also committed on the saxon11 branch (in run-samples.gradle):
i.e. added validate_report_Validate_1
and validate_report_Validate_2
in run_cmd_books_sample_tests
as above.
Updated by Debbie Lockett 9 months ago
- Status changed from In Progress to Resolved
- % Done changed from 100 to 50
- Fixed in Maintenance Release deleted (
12.3, 11.6)
For validation reports from successful validations to be valid, the attribute minOccurs="0"
is required on xs:element ref="v:error"
.
I have committed this fix on the main, saxon12 and saxon11 branches (along with some other minor tidying). The tests now pass.
Updated by O'Neil Delpratt 2 months ago
- % Done changed from 50 to 100
- Fixed in Maintenance Release 12.5 added
Bug fix applied in the Saxon 12.5 Maintenance release. Not marking this closed until patched in older releases (i.e 11.x).
Please register to edit this issue