You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2022/09/06 11:27:31 UTC

[GitHub] [daffodil] jadams-tresys commented on a diff in pull request #836: Exi fixes

jadams-tresys commented on code in PR #836:
URL: https://github.com/apache/daffodil/pull/836#discussion_r963592355


##########
daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala:
##########
@@ -695,9 +696,13 @@ object Main {
       case InfosetType.W3CDOM => Left(new W3CDOMInfosetOutputter())
       case InfosetType.SAX => Right(new DaffodilParseOutputStreamContentHandler(os, pretty=true))
       case InfosetType.EXI => {
-        val exiFactory = DefaultEXIFactory.newInstance()
-        exiFactory.getFidelityOptions.setFidelity(FidelityOptions.FEATURE_PREFIX, true)
-        val exiResult = new EXIResult()
+        val exiFactory = DefaultEXIFactory.newInstance
+        if (schemaOpt.isDefined) {
+          val grammarFactory = GrammarFactory.newInstance
+          val grammar = grammarFactory.createGrammars(schemaOpt.get.toURL.openStream(), DFDLCatalogResolver.get)

Review Comment:
   I didn't realize that getInfosetOutputter gets called on every run  Having the factory set up once will also help with clarity for unparsing as well as there will only be one EXIFactory created that can be used for both parsing and unparsing.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org