Skip to content

Add CLI option to pass options to infoset inputters and outputters - #1743

Open
olabusayoT wants to merge 1 commit into
apache:mainfrom
olabusayoT:daf-2234-infoset-options
Open

olabusayoT wants to merge 1 commit into
apache:mainfrom
olabusayoT:daf-2234-infoset-options

Conversation

@olabusayoT

Copy link
Copy Markdown
Contributor

Add a --infoset-opts option to the parse and unparse commands that takes a comma separated list of key=value pairs, for example --infoset-opts=pretty=false,xmlTextEscape=CDATA. Pairs are validated against the selected infoset type and collected into an InfosetOptions object that is passed to the infoset handlers, so new options need only a key definition and a handler change. Pair splitting is a new Misc.parseKeyValuePairs utility.

Initial keys are pretty (true or false, for xml, json, and sax infosets), which previously could not be turned off, xmlTextEscape (Standard or CDATA, for xml infosets), which exposes the existing XMLTextEscapeStyle, and exiCompression (true or false, for exi and exisa infosets), which selects EXI compression. Unknown keys, invalid values, and keys that do not apply to the infoset type are reported as usage errors. Each key's values, description, applicable infoset types, and default are generated into the command help from the key definitions.

Library constructors are unchanged.

DAFFODIL-2234

Add a --infoset-opts option to the parse and unparse commands that takes a comma separated list of key=value pairs, for example --infoset-opts=pretty=false,xmlTextEscape=CDATA. Pairs are validated against the selected infoset type and collected into an InfosetOptions object that is passed to the infoset handlers, so new options need only a key definition and a handler change. Pair splitting is a new Misc.parseKeyValuePairs utility.

Initial keys are pretty (true or false, for xml, json, and sax infosets), which previously could not be turned off, xmlTextEscape (Standard or CDATA, for xml infosets), which exposes the existing XMLTextEscapeStyle, and exiCompression (true or false, for exi and exisa infosets), which selects EXI compression. Unknown keys, invalid values, and keys that do not apply to the infoset type are reported as usage errors. Each key's values, description, applicable infoset types, and default are generated into the command help from the key definitions.

The parse command now closes its output file when it finishes, so the file can be deleted on Windows when the CLI runs in the same process as a test.

Library constructors are unchanged.

DAFFODIL-2234
@olabusayoT
olabusayoT force-pushed the daf-2234-infoset-options branch from b1647b7 to 6e5629d Compare October 7, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant