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 2019/10/17 14:27:25 UTC

Another question about creating TDML files - how to specify the output should be an error?

Hi Folks,

In my TDML file I want to express this: Parsing the input file should result in producing an error. Is there a way to express that?

/Roger

Re: Another question about creating TDML files - how to specify the output should be an error?

Posted by "Sloane, Brandon" <bs...@tresys.com>.
Yes.

Instead of providing a <tdml:infoset> element, provide:


<tdml:errors>
  <tdml:error>Schema Definition Error</tdml:error>
  <tdml:error>expected error message</tdml:error>
</tdml:errors>

You can also provide expected warnings:

<tdml:warnings>
  <tdml:warning>Schema Definition Warning</tdml:warning>
  <tdml:warning>expected message</tdml:warning>
</tdml:warnings>

Each string provide in <tdml:error/> and <tdml:warning/> is then expect to occur as a substring in an error or warning message produced.

We have many examples of TDML files you can reference here: https://github.com/apache/incubator-daffodil/tree/master/daffodil-test/src/test/scala/org/apache/daffodil
________________________________
From: Costello, Roger L. <co...@mitre.org>
Sent: Thursday, October 17, 2019 10:27 AM
To: users@daffodil.apache.org <us...@daffodil.apache.org>
Subject: Another question about creating TDML files - how to specify the output should be an error?


Hi Folks,



In my TDML file I want to express this: Parsing the input file should result in producing an error. Is there a way to express that?



/Roger