stevedlawrence commented on code in PR #878:
URL: https://github.com/apache/daffodil/pull/878#discussion_r1033514969
##########
daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala:
##########
@@ -1482,6 +1518,74 @@ object Main {
}
}
+ case Some(conf.encodeEXI) => {
+ val encodeOpts = conf.encodeEXI
+ val channel = encodeOpts.output.toOption match {
+ case Some("-") | None => Channels.newChannel(STDOUT)
+ case Some(file) => new FileOutputStream(file).getChannel()
+ }
+ val output = Channels.newOutputStream(channel)
+
+ val inputStream = encodeOpts.infile.toOption match {
+ case Some("-") | None => STDIN
+ case Some(file) => {
+ val f = new File(file)
+ new FileInputStream(f)
+ }
+ }
+ val input = new InputSource(inputStream)
+
+ val exiFactory = {
+ if (encodeOpts.schema.isDefined)
+ getExiFactoryOpt(InfosetType.EXISA, encodeOpts.schema.toOption)
+ else
+ getExiFactoryOpt(InfosetType.EXI, encodeOpts.schema.toOption)
+ }
Review Comment:
I've merged that PR.
I think the changes you'll need are to make the `exiFactory` member of the
`EXIInfosetHandler` public here:
https://github.com/apache/daffodil/blob/main/daffodil-cli/src/main/scala/org/apache/daffodil/InfosetTypes.scala#L676
Then you can call `getInfosetHandler` and access that `exiFactory` member.
This only changes how you get the factory though, so I think everything else
should be the same.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]