You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Steve Lawrence (Jira)" <ji...@apache.org> on 2023/01/04 15:33:00 UTC
[jira] [Commented] (DAFFODIL-2234) CLI needs to pass options to infoset inputters/outputters
[ https://issues.apache.org/jira/browse/DAFFODIL-2234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17654510#comment-17654510 ]
Steve Lawrence commented on DAFFODIL-2234:
------------------------------------------
Maybe another option could be to extend the syntax for the {-}I option{-}-maybe it has a optional colon separated list of key=value pairs? For example
{code:java}
-I xml:pretty=true:xmlStyle=cdata
{code}
Or maybe it would have a syntax similar to the --validate option, which has some capabilities for to specify a config file and I think something similar to key/value pairs.
I'm not sure how I feel about that yet, but just throwing out another alternative.
> CLI needs to pass options to infoset inputters/outputters
> ---------------------------------------------------------
>
> Key: DAFFODIL-2234
> URL: https://issues.apache.org/jira/browse/DAFFODIL-2234
> Project: Daffodil
> Issue Type: Improvement
> Components: CLI
> Affects Versions: 2.4.0
> Reporter: Mike Beckerle
> Priority: Minor
> Labels: beginner
>
> Pretty printing is undesirable for many use cases. This applies to both XML pretty printing and JSON pretty printing. The XMLInfosetOutputter constructor already takes a boolean 'pretty' parameter, but we don't have any way for the CLI to change this constructor parameter's value from true to false in the places where the codebase passes true.
> The issue here is how do we let the CLI pass options to infoset inputters/outputters such as (not) pretty printing JSON/XML or using CDATA to preserve whitespace in XML text? We also need to let the CLI to pass options to the TDML runner for its infoset inputters/outputters where that makes sense.
> Infoset inputters/outputters created by the user or the CLI don't have any access to tunables when they are created. The only parts of Daffodil that have access to tunables are the Compiler/ProcessorFactory/DataProcessor which have withTunable/withTunables functions. Should we add withTunable/Tunables functions to infoset inputters/outputters?
> One opinion is the CLI option could use the same {{-T}} flag and the Daffodil code could just figure out which key/value pairs are tunables and which are infoset inputter/outputter parameters. Another opinion is that feels like a bit of a hack and the CLI should have another option (maybe -i to match -I for infoset types).
> Finally, the infoset inputters/outputters currently take options as constructor parameters. However, withXXX functions are a better API for binary compatibility and future extensibility than constructor parameters. A pull request should also clean up the infoset inputters/outputters' API to use a cleaner API for passing options.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)