You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Mike Beckerle (Jira)" <ji...@apache.org> on 2021/07/02 22:03:00 UTC

[jira] [Created] (DAFFODIL-2541) DaffodilXMLLoader - eliminate error handler and return diagnostics

Mike Beckerle created DAFFODIL-2541:
---------------------------------------

             Summary: DaffodilXMLLoader - eliminate error handler and return diagnostics
                 Key: DAFFODIL-2541
                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2541
             Project: Daffodil
          Issue Type: Improvement
          Components: Clean Ups, Diagnostics
    Affects Versions: 3.1.0
            Reporter: Mike Beckerle


There is a lot of complex code in Daffodil to deal with parsing DFDL Schemas as XML, parsing XML docs such as TDML files etc.

The complexity to some degree is caused by the way SAX parsers report errors, which is by side-effect calls to an error handler object.

Daffodil is largely functional programming, and this side-effect style just has to be worked around everyplace we load/validate XML.

The DaffodilXMLLoader really should be a function that returns type:

```

(Option[Elem],Seq[SAXParseException])

```

A standard call can then also convert these SAXParseException into SDE/SDW for use from the schema compiler.

The TDML Runner loading of data files and such wants to treat the errors/warnings differently, so that's why the DaffodilXMLLoader cannot always convert to SDE/SDW objects uniformly.

This would clean up the code substantially.

 

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)