You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@daffodil.apache.org by Roger L Costello <co...@mitre.org> on 2020/12/11 16:06:32 UTC

"Property fillByte is not defined"

Hi Folks,

I installed the latest version of Daffodil (3.0).

My DFDL schema worked with previous versions of Daffodil, but now it doesn't work ...

My DFDL schema is below. It is a simple schema to parse comma-separated instances like this:

a,b,c

Daffodil complained that I didn't have fillByte on element DataItem1, so I added one. Then it complained that I didn't have fillByte on element DataItem2, so I added one. And DateItem3. Then it complained that I didn't have fillByte on xs:sequence, so I added one. Despite adding fillByte everywhere, Daffodil continues to complain that the schema doesn't have fillByte defined. What am I doing wrong, please?  /Roger

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/">

    <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"
                alignment="1"
                alignmentUnits="bytes"
                textPadKind="none"
                textTrimKind="none"
                truncateSpecifiedLengthString="no"
                escapeSchemeRef=""
                representation="text"
                encoding="ASCII"
                lengthKind = "delimited"
                initiator = ""
                terminator = ""
                ignoreCase = "yes"
                sequenceKind="ordered"
                initiatedContent="no"
                fillByte=" "
            />
        </xs:appinfo>
    </xs:annotation>

    <xs:element name="SimpleDataFormat">
        <xs:complexType>
            <xs:sequence
                dfdl:separator=","
                dfdl:separatorPosition="infix"  dfdl:fillByte=" "
                >
                <xs:element name="DataItem1" type="xs:string" dfdl:fillByte=" " />
                <xs:element name="DataItem2" type="xs:string" dfdl:fillByte=" "/>
                <xs:element name="DataItem3" type="xs:string" dfdl:fillByte=" " />
            </xs:sequence>
        </xs:complexType>
    </xs:element>

</xs:schema>





Re: "Property fillByte is not defined"

Posted by Steve Lawrence <sl...@apache.org>.
As of 3.0, the dfdl:fillByte is now required for all elements, even if
it may not be used. We had a bug where we didn't require the property
even though there were cases where it was needed. Because we didn't
require it, we didn't know it was missing until runtime which lead to an
exception. Rather than trying to figure out exactly when it is and isn't
needed at schema compile time, it's easiest to just always require it
where it *might* be needed.

The easiest way to add this is to just specified it once in the
dfdl:format tag so it is applied globally. Which is what you have.

But when I try to compile your schema, I get a different error:

Schema Definition Error: For fillByte, the string ( ) must not contain
any whitespace. Use DFDL Entities for whitespace characters.

So the issue here is that you cannot use a space character to specify a
space fillByte. Instead you need to use a DFDL entity, e.g. fillByte="%SP;"


On 12/11/20 11:06 AM, Roger L Costello wrote:
> Hi Folks,
> 
> I installed the latest version of Daffodil (3.0).
> 
> My DFDL schema worked with previous versions of Daffodil, but now it doesn’t work …
> 
> My DFDL schema is below. It is a simple schema to parse comma-separated 
> instances like this:
> 
> a,b,c
> 
> Daffodil complained that I didn’t have fillByte on element DataItem1, so I added 
> one. Then it complained that I didn’t have fillByte on element DataItem2, so I 
> added one. And DateItem3. Then it complained that I didn’t have fillByte on 
> xs:sequence, so I added one. Despite adding fillByte everywhere, Daffodil 
> continues to complain that the schema doesn’t have fillByte defined. What am I 
> doing wrong, please?  /Roger
> 
> <xs:schemaxmlns:xs="http://www.w3.org/2001/XMLSchema 
> <http://www.w3.org/2001/XMLSchema>"
> xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/ <http://www.ogf.org/dfdl/dfdl-1.0/>">
> 
> <xs:annotation>
> <xs:appinfosource="http://www.ogf.org/dfdl/ <http://www.ogf.org/dfdl/>">
> <dfdl:format
>                  textBidi="no"
>                  separatorSuppressionPolicy="never"
>                  floating="no"
>                  encodingErrorPolicy="replace"
>                  outputNewLine="%CR;%LF;"
>                  leadingSkip="0"
>                  trailingSkip="0"
>                  alignment="1"
>                  alignmentUnits="bytes"
>                  textPadKind="none"
>                  textTrimKind="none"
>                  truncateSpecifiedLengthString="no"
>                  escapeSchemeRef=""
>                  representation="text"
>                  encoding="ASCII"
>                  lengthKind = "delimited"
>                  initiator = ""
>                  terminator = ""
>                  ignoreCase = "yes"
>                  sequenceKind="ordered"
>                  initiatedContent="no"
>                  fillByte=" "
> />
> </xs:appinfo>
> </xs:annotation>
> 
> <xs:elementname="SimpleDataFormat">
> <xs:complexType>
> <xs:sequence
>                  dfdl:separator=","
>                  dfdl:separatorPosition="infix"dfdl:fillByte=" "
>>
> <xs:elementname="DataItem1"type="xs:string"dfdl:fillByte=" "/>
> <xs:elementname="DataItem2"type="xs:string"dfdl:fillByte=" "/>
> <xs:elementname="DataItem3"type="xs:string"dfdl:fillByte=" "/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> 
> </xs:schema>
>