Project

Profile

Help

Bug #6086

closed

Is the schema validation-reports.xsd up to date?

Added by Martin Honnen 10 months ago. Updated 5 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Diagnostics
Sprint/Milestone:
-
Start date:
2023-06-20
Due date:
% Done:

50%

Estimated time:
Legacy ID:
Applies to branch:
11, 12, trunk
Fix Committed on Branch:
11, 12, trunk
Fixed in Maintenance Release:
Platforms:
.NET, Java

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.

Actions #1

Updated by Michael Kay 10 months 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.

Actions #2

Updated by Michael Kay 10 months 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
Actions #3

Updated by O'Neil Delpratt 10 months 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.

Actions #4

Updated by O'Neil Delpratt 10 months ago

  • Status changed from Closed to Resolved

Leaving this bug issue as resolved until resolved against Saxon 11.

Actions #5

Updated by Debbie Lockett 8 months ago

  • Status changed from Resolved to Closed
  • Fixed in Maintenance Release 11.6 added

Bug fix applied in the Saxon 11.6 maintenance release.

Actions #6

Updated by Debbie Lockett 5 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.

Actions #7

Updated by Debbie Lockett 5 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.

Actions #8

Updated by Debbie Lockett 5 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.

Actions #9

Updated by Debbie Lockett 5 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.

Please register to edit this issue

Also available in: Atom PDF