What version of Daffodil? 2.5.0? ________________________________ From: Costello, Roger L. <[email protected]> Sent: Monday, April 13, 2020 11:22 AM To: [email protected] <[email protected]> Subject: Re: Two bugs in Daffodil?
Hi Mike, Below is the schema. It has initiator and encoding in dfdl:format. Schema works fine. Remove them and place them in the element declaration for age. Schema breaks. /Roger <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" xmlns:fn="http://www.w3.org/2005/xpath-functions" elementFormDefault="qualified"> <xs:annotation> <xs:appinfo source="http://www.ogf.org/dfdl/"> <dfdl:format textBidi="no" separatorSuppressionPolicy="never" floating="no" encodingErrorPolicy="replace" outputNewLine="%CR;%LF;" leadingSkip="0" trailingSkip="0" textPadKind="none" textTrimKind="none" truncateSpecifiedLengthString="no" escapeSchemeRef="" initiator="" terminator="" encoding="ASCII" /> </xs:appinfo> </xs:annotation> <xs:element name="SimpleBinaryDataFormat" dfdl:representation="binary" dfdl:lengthKind="delimited" dfdl:initiator="" dfdl:terminator="" dfdl:alignment="1" dfdl:alignmentUnits="bytes" dfdl:byteOrder="littleEndian"> <xs:complexType> <xs:sequence dfdl:initiator="" dfdl:sequenceKind="ordered" dfdl:terminator="" dfdl:separator="" dfdl:alignment="1" dfdl:alignmentUnits="bytes" dfdl:ignoreCase="yes" dfdl:initiatedContent="no"> <xs:element name="name" type="xs:string" dfdl:representation="text" dfdl:encoding="ASCII" dfdl:terminator="%NUL;" dfdl:initiator="" dfdl:emptyValueDelimiterPolicy="terminator" dfdl:ignoreCase="yes" dfdl:lengthKind="delimited" dfdl:alignment="1" dfdl:alignmentUnits="bytes" /> <xs:element name="age" type="xs:nonNegativeInteger" dfdl:representation="binary" dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes" dfdl:length="1" dfdl:alignment="1" dfdl:alignmentUnits="bytes" dfdl:byteOrder="littleEndian" dfdl:binaryNumberRep="binary" /> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> From: Beckerle, Mike <[email protected]> Sent: Monday, April 13, 2020 11:17 AM To: [email protected] Subject: [EXT] Re: Two bugs in Daffodil? Sure sounds like bugs. Can you send the whole schema please? ________________________________ From: Costello, Roger L. <[email protected]<mailto:[email protected]>> Sent: Monday, April 13, 2020 11:11 AM To: [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>> Subject: Two bugs in Daffodil? Hi Folks, I have a binary data format. One field is a 1-byte name representing a person's age. I have it defined like so: <xs:element name="age" type="xs:nonNegativeInteger" dfdl:representation="binary" dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes" dfdl:length="1" dfdl:alignment="1" dfdl:alignmentUnits="bytes" dfdl:byteOrder="littleEndian" dfdl:binaryNumberRep="binary" /> Daffodil gives this error message: [error] Schema Definition Error: Property encoding is not defined. Huh? Why do I have to specify a (character) encoding on a binary nonNegativeInteger field? Next, I thought, "Okay, that doesn't make sense, but let me put dfdl:encoding="ASCII" on the element declaration." I did so, and yet I got the same error message! Curiously, when I put the encoding in dfdl:format then the error message went away. Conclusion: Daffodil has a bug. Daffodil sometimes does not recognize the encoding property on an element declaration. Do you agree? There is the exact same problem with initiator. I put dfdl:initiator="" on the element declaration and Daffodil says there is no initiator. When I put it on dfdl:format, Daffodil doesn't give an error. I believe this is aother bug. Do you agree? /Roger
