Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DFDL-415

Accumulate multiple DFDL Schema validation errors

XMLWordPrintableJSON

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • s7
    • s5
    • Front End
    • None

      Right now first thing that the Daffodil front end does is feed the DFDL schema to Xerces for validation against the Schema for DFDL Schemas, which also includes the schema for DFDL annotations.

      This does not accumulate validation errors. It throws an exception, which is caught and turned into a single diagnostic.

      It would be better if multiple such schema validation errors could be gathered and reported rather than just one.

      (This bug rated 'minor' because tooling such as Eclipse helps find and isolate multiple such schema authoring issues at once, so that ameliorates the problem.)

      Details on how to fix: From email thread between Mike Beckerle and Jonathan Cranford in discussion on this topic:

      Mike,

      Sorry, I'm still catching up on email from before my move west.

      Have you tried setting an ErrorHandler?

      Here's some code snipped from XML Calabash that demonstrates the API:

      Schema schema = factory.newSchema(new SAXSource(is));
      Validator validator = schema.newValidator();
      validator.setErrorHandler(new XSDErrorHandler());

      Norm Walsh added the ability to XML Calabash just recently (well, early this year) to report more than one schema validation error. See the commit difference in his ValidateWithXSD class.

      Let me know if that helps,

      -Jonathan

              jchab Jessie Chab
              mbeckerle.dfdl Mike Beckerle
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: