Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DAFFODIL-2234

CLI needs to pass options to infoset inputters/outputters

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: In Progress
    • Minor
    • Resolution: Unresolved
    • 2.4.0
    • 4.0.0
    • CLI

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mbeckerle Mike Beckerle
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: