[
https://issues.apache.org/jira/browse/DAFFODIL-1749?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17531947#comment-17531947
]
Mike Beckerle commented on DAFFODIL-1749:
-----------------------------------------
Note that per
[https://mukulgandhi.blogspot.com/2010/03/xerces-j-xsmodel-serialization.html]
An XML Schema can be converted to an XSModel and that can be serialized as a
java object. One can create a Xerces validating parser from an XSModel.
Hence, one can save the DFDL Schema (for use in Xerces validation) as an
XSModel and include that in the saved DFDL processor state.
This would eliminate the need to deal with the DFDL schema as XML text
files/strings. Basically it elides all the include/import hassle.
This does not, however, eliminate any startup overhead the XML Validator has
for compiling this XSModel of the schema to whatever low-level runtime data
structures it uses. It gets rid of some overhead, but not any true
compilation/transformation of the schema data objects for fast validation
parsing.
> Store Xerces validator in DataProcessor so reloaded parsers can use full
> validation
> -----------------------------------------------------------------------------------
>
> Key: DAFFODIL-1749
> URL: https://issues.apache.org/jira/browse/DAFFODIL-1749
> Project: Daffodil
> Issue Type: Improvement
> Components: CLI
> Reporter: Steve Lawrence
> Priority: Major
>
> With validation mode set to full, after a parse we have xerces recompile the
> schema and validate against the infoset. That is painful. Instead we should
> create a Xerces validator once (if full validation is enabled) and reuse the
> same one for each parse. That should give a noticeable gain in performance
> with full validation. Need to confirm that the xerces validator is thread
> safe and treat it appropriately if not
> Also, we *might* be able to serialize the xerces validator as part of saving
> a parser. This would be nice so that we could enable full validation for
> saved parsers.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)