Ah!

Excellent explanation. 

Thanks Steve!

/Roger

-----Original Message-----
From: Steve Lawrence <[email protected]> 
Sent: Monday, August 26, 2019 12:41 PM
To: [email protected]
Subject: [EXT] Re: Why do I get this warning message: DFDL property was 
ignored: representation="text"

Since it never makes sense to have a string with representation="binary", when 
the type is xs:string the representation is always implied to be "text". We 
don't even bother looking at the value of representation--it's just completely 
ignored.

A new feature in Daffodil 2.4 warns when properties are ignore, so you now get 
a warning when representation is defined on string elements.
Functionally, it's exactly the same as in 2.3, you just now get a warning.

To get rid of the warning, you can either turn it off by disabling the 
"ignoreDFDLProperty" warning, or you can just remove the 
dfdl:representation="text" property from that element. I'd recommend the latter 
as it is actually pretty good at finding legitimate bugs in schemas.

Note that for hexBinary, the representation is always implied to by "binary", 
so you also never need representation on elements with xs:hexBinary types.


On 8/26/19 12:29 PM, Costello, Roger L. wrote:
> Hello DFDL community,
> 
> My input is a binary file. I want my DFDL schema to consume hexBinary 
> bytes until it gets to the string "/This program cannot be run in DOS mode/".
> 
> Parsing the input with the below DFDL schema results in this warning message:
> 
> *[warning] Schema Definition Warning: DFDL property was ignored: 
> representation="text"*
> 
> Why?
> 
> The DFDL schema worked fine in Daffodil version 2.3.0 but now in 2.4.0 I get 
> the 
> above warning.   /Roger
> 
> <xs:elementname="DOS_Stub">
> <xs:complexType>
> <xs:sequence>
> <xs:elementname="Instructions"type="xs:hexBinary"
>                  dfdl:lengthKind="pattern"
>                  dfdl:lengthPattern="[\x00-\xFF]+?(?=This program 
> cannot be run in DOS mode\.)"/> 
> <xs:elementname="Message"type="xs:string"
>                  dfdl:lengthUnits="characters"
>                  dfdl:lengthKind="explicit"
>                  dfdl:length="39"
> dfdl:representation="text"
>                  dfdl:encoding="ISO-8859-1"/> </xs:sequence> 
> </xs:complexType> </xs:element>
> 

Reply via email to