Ability to validate the .dfdl.xsd schema file before starting debug operation.
Need to brainstorm the use case for this validation operation. It is okay to debug uncompleted schema during schema development but are there use cases where invalid or incomplete dfdl schema needs to be debugged?
Based on Steve Lawrence's suggestion below,
"Maybe what this extension needs is a separate button for compiling a schema vs debugging a schema? This is probably in line with most other language extensions (e.g. Java compile + debug). Compiling will run the normal compilation steps to create a DataProcessor (including schema validation) and then the debugging step can use the resulting DataProcessor to parse files and debug. This way if you want to debug multiple times you can detect if any schema files have changed and if not avoid that potentially costly recompilation. You could even make use of the DataProcessor.save() and Compiler.reload() functions to serialize a DataProcessor so it does not needed to be cached in memory."
The -V / --validate flag does not validate the raw schema input file directly, and it does not mean “validate the DFDL schema before parsing.” For the parse command, it validates the DFDL infoset produced by the parse.
save-parser compiles and validates the DFDL schema. It is the closest Daffodil CLI equivalent to a “validate schema” command.
Implement above as compiling schema also validates schema and adds a compile-first workflow for DFDL schema debugging and enables parser reuse across debug sessions when schema inputs are unchanged.
Ability to validate the .dfdl.xsd schema file before starting debug operation.
Need to brainstorm the use case for this validation operation. It is okay to debug uncompleted schema during schema development but are there use cases where invalid or incomplete dfdl schema needs to be debugged?
Based on Steve Lawrence's suggestion below,
"Maybe what this extension needs is a separate button for compiling a schema vs debugging a schema? This is probably in line with most other language extensions (e.g. Java compile + debug). Compiling will run the normal compilation steps to create a DataProcessor (including schema validation) and then the debugging step can use the resulting DataProcessor to parse files and debug. This way if you want to debug multiple times you can detect if any schema files have changed and if not avoid that potentially costly recompilation. You could even make use of the DataProcessor.save() and Compiler.reload() functions to serialize a DataProcessor so it does not needed to be cached in memory."
The -V / --validate flag does not validate the raw schema input file directly, and it does not mean “validate the DFDL schema before parsing.” For the parse command, it validates the DFDL infoset produced by the parse.
save-parser compiles and validates the DFDL schema. It is the closest Daffodil CLI equivalent to a “validate schema” command.
Implement above as compiling schema also validates schema and adds a compile-first workflow for DFDL schema debugging and enables parser reuse across debug sessions when schema inputs are unchanged.