You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@daffodil.apache.org by "Costello, Roger L." <co...@mitre.org> on 2020/04/27 13:07:46 UTC

Can Daffodil do just validation (not parse to XML/JSON)?

Hi Folks,

So, a standards organization created a description of a data format. They expressed that description using DFDL.

Then, I created an instance of the data format. Now I'd like to know if my instance is valid, i.e., does it conform to the DFDL description that the standards organization created. I'm not interested in outputting an XML or JSON representation of the instance. I simply want to know if my instance is valid. I want the output to be either yes it's valid, or no it's not valid. (Analogously, an XML Schema validator can output a detailed infoset or it can output simply valid/invalid) Can Daffodil do this? 

/Roger

Re: Can Daffodil do just validation (not parse to XML/JSON)?

Posted by Steve Lawrence <sl...@apache.org>.
Sort of. Daffodil will always create an internal infoset, which is
necessary for all the parsing and validation logic.

And Daffodil will always follow the codepath to output that infoset when
the parse completes. However, in addition to outputting to XML or JSON
we have a special InfosetOutputter that doesn't actually output
anything, called the NullInfosetOutputter. To use this with the CLI, you
can add "-I null" to your arguments, e.g.

  daffodil parse -s foo.dfdl.xsd --validate=on -I null inputData.bin

This causes no infoset to be output when the parse completes. If there
were validation errors, they will be printed to stderr and the exit code
will be 1.

On 4/27/20 9:07 AM, Costello, Roger L. wrote:
> Hi Folks,
> 
> So, a standards organization created a description of a data format. They expressed that description using DFDL.
> 
> Then, I created an instance of the data format. Now I'd like to know if my instance is valid, i.e., does it conform to the DFDL description that the standards organization created. I'm not interested in outputting an XML or JSON representation of the instance. I simply want to know if my instance is valid. I want the output to be either yes it's valid, or no it's not valid. (Analogously, an XML Schema validator can output a detailed infoset or it can output simply valid/invalid) Can Daffodil do this? 
> 
> /Roger
>