hdalsania opened a new issue, #1762:
URL: https://github.com/apache/daffodil-vscode/issues/1762
## Problem Description
Apache Daffodil’s parse command supports the -V / --validate option for
validating the infoset generated during parsing:
`-V, --validate <validator_name>`
The VS Code extension should provide equivalent configuration for parse and
debug operations.
This is different from #1273 , which validates the DFDL schema during schema
compilation. This issue concerns validation of the resulting infoset after data
has been parsed.
The current Apache Daffodil CLI supports the following validators:
```
off — disable infoset validation
daffodil — use Daffodil’s built-in XML Schema validation
xerces[=value] — use Xerces XML Schema validation
schematron[=value] — use Schematron validation
Custom validators registered with Daffodil
```
The optional value identifies a validator configuration file, such as an
.xsd, .sch, .conf, or .properties file.
For example:
```
daffodil parse -s schema.dfdl.xsd -V daffodil input.dat
daffodil parse -s schema.dfdl.xsd -V xerces input.dat
daffodil parse -s schema.dfdl.xsd -V schematron=rules.sch input.dat
```
## Proposed Solution
Add an infoset validation option to the extension’s launch configuration and
Launch Wizard.
Possible launch configuration (consider to keep it with infoset config
options):
```
{
"validation": {
"validator": "xerces",
"configuration": "${workspaceFolder}/schema.dfdl.xsd"
}
}
```
The `configuration `property should be optional and used only when required
by the selected validator (Xerces or schematron).
The extension does not necessarily need to invoke the Daffodil CLI directly.
It may implement the equivalent functionality through the DAPodil interfaces.
## Acceptance Criteria
- Launch configurations support an infoset validation setting.
- The Launch Wizard allows users to select off, daffodil, xerces, or
schematron.
- Validation defaults to off.
- Allow an optional configuration file for validators that support one.
- The selected validator is applied during parsing.
- Validation diagnostics are displayed in VS Code.
- Validation diagnostics are distinguishable from schema compilation and
parse errors.
- Existing launch configurations remain backward compatible.
- Continue producing or displaying the infoset when Daffodil makes it
available following a validation failure.
- Documentation explains the difference between this feature and schema
validation in #1273.
## Impact and Benefits
This feature allows users to validate the generated infoset directly in VS
Code, identifying data that parses successfully but violates XSD or Schematron
constraints. It improves Daffodil CLI parity and provides earlier feedback
without leaving the IDE.
--
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]