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/02/05 16:18:54 UTC

Strange error message on unparsing ... element does not have a value

Hello DFDL community,

My input file is binary, in little endian format. It contains two 2-byte values. Each value represents a hex address. My schema reverses the order of the bytes in each address. For example, with this hex input:

80 00 10 00

This is the XML that is output:


<input>
    <address1>0080</address1>
    <address2>0010</address2>
</input>

Note that the two bytes in each address are reversed.

Parsing works as desired. However, unparsing generates a strange error:

[warning] BLOCKED
exc=One(org.apache.daffodil.infoset.OutputValueCalcEvaluationException: Expression Evaluation Error: Element {}Hidden_address1_byte1 does not have a value.
Schema context: Hidden_address1_byte1
node=One(DISimple(name='Hidden_address1_byte1' contentLen(One(0)unk, One(8)unk) valueLen(One(0)unk, One(0)DOS(id=0.1))))
info=One(DPathElementCompileInfo(Hidden_address1_byte1))
index=MaybeInt(0)

Below is my schema. What am I doing wrong, please?  /Roger

<xs:element name="two-addresses">
    <xs:complexType>
        <xs:sequence>
            <xs:sequence dfdl:hiddenGroupRef="hidden_address1_Group" />
            <xs:element name="address1" type="xs:string" dfdl:inputValueCalc='{
                fn:concat(xs:string(../Hidden_address1_byte2), xs:string(../Hidden_address1_byte1))}'/>
            <xs:sequence dfdl:hiddenGroupRef="hidden_address2_Group" />
            <xs:element name="address2" type="xs:string" dfdl:inputValueCalc='{
                fn:concat(xs:string(../Hidden_address2_byte2), xs:string(../Hidden_address2_byte1))}'/>
        </xs:sequence>
    </xs:complexType>
</xs:element>

<xs:simpleType name="hexBinary1" dfdl:length="1" dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes">
    <xs:restriction base="xs:hexBinary"/>
</xs:simpleType>

<xs:group name="hidden_address1_Group">
    <xs:sequence>
        <xs:element name="Hidden_address1_byte1" type="hexBinary1" dfdl:outputValueCalc='{ . }' />
        <xs:element name="Hidden_address1_byte2" type="hexBinary1" dfdl:outputValueCalc='{ . }' />
    </xs:sequence>
</xs:group>

<xs:group name="hidden_address2_Group">
    <xs:sequence>
        <xs:element name="Hidden_address2_byte1" type="hexBinary1" dfdl:outputValueCalc='{ . }' />
        <xs:element name="Hidden_address2_byte2" type="hexBinary1" dfdl:outputValueCalc='{ . }' />
    </xs:sequence>
</xs:group>



Re: Strange error message on unparsing ... element does not have a value

Posted by "Beckerle, Mike" <mb...@tresys.com>.
This bad message is from the deadlock detector in the unparser. It means you have a cycle in calculations so the unparser cant continue.


Looking at your schema. I see several outputValueCalc="{.}" That's a cycle immediately.

Get Outlook for Android<https://aka.ms/ghei36>

________________________________
From: Costello, Roger L. <co...@mitre.org>
Sent: Tuesday, February 5, 2019 11:18:54 AM
To: users@daffodil.apache.org
Subject: Strange error message on unparsing ... element does not have a value

Hello DFDL community,

My input file is binary, in little endian format. It contains two 2-byte values. Each value represents a hex address. My schema reverses the order of the bytes in each address. For example, with this hex input:

80 00 10 00

This is the XML that is output:


<input>
    <address1>0080</address1>
    <address2>0010</address2>
</input>

Note that the two bytes in each address are reversed.

Parsing works as desired. However, unparsing generates a strange error:

[warning] BLOCKED
exc=One(org.apache.daffodil.infoset.OutputValueCalcEvaluationException: Expression Evaluation Error: Element {}Hidden_address1_byte1 does not have a value.
Schema context: Hidden_address1_byte1
node=One(DISimple(name='Hidden_address1_byte1' contentLen(One(0)unk, One(8)unk) valueLen(One(0)unk, One(0)DOS(id=0.1))))
info=One(DPathElementCompileInfo(Hidden_address1_byte1))
index=MaybeInt(0)

Below is my schema. What am I doing wrong, please?  /Roger

<xs:element name="two-addresses">
    <xs:complexType>
        <xs:sequence>
            <xs:sequence dfdl:hiddenGroupRef="hidden_address1_Group" />
            <xs:element name="address1" type="xs:string" dfdl:inputValueCalc='{
                fn:concat(xs:string(../Hidden_address1_byte2), xs:string(../Hidden_address1_byte1))}'/>
            <xs:sequence dfdl:hiddenGroupRef="hidden_address2_Group" />
            <xs:element name="address2" type="xs:string" dfdl:inputValueCalc='{
                fn:concat(xs:string(../Hidden_address2_byte2), xs:string(../Hidden_address2_byte1))}'/>
        </xs:sequence>
    </xs:complexType>
</xs:element>

<xs:simpleType name="hexBinary1" dfdl:length="1" dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes">
    <xs:restriction base="xs:hexBinary"/>
</xs:simpleType>

<xs:group name="hidden_address1_Group">
    <xs:sequence>
        <xs:element name="Hidden_address1_byte1" type="hexBinary1" dfdl:outputValueCalc='{ . }' />
        <xs:element name="Hidden_address1_byte2" type="hexBinary1" dfdl:outputValueCalc='{ . }' />
    </xs:sequence>
</xs:group>

<xs:group name="hidden_address2_Group">
    <xs:sequence>
        <xs:element name="Hidden_address2_byte1" type="hexBinary1" dfdl:outputValueCalc='{ . }' />
        <xs:element name="Hidden_address2_byte2" type="hexBinary1" dfdl:outputValueCalc='{ . }' />
    </xs:sequence>
</xs:group>



RE: Strange error message on unparsing ... element does not have a value

Posted by "Costello, Roger L." <co...@mitre.org>.
Looking at your schema. I see several outputValueCalc="{.}" That's a cycle immediately.

Ah! That's a mistake that I find myself repeatedly making. In XPath the dot ( . ) means here/self, so I mistakenly interpret outputValueCalc="{.}" to mean "Output the value of here/self" which I now realize (remember) is not correct.

Thanks Mike.

/Roger

From: Beckerle, Mike <mb...@tresys.com>
Sent: Tuesday, February 5, 2019 11:31 AM
To: users@daffodil.apache.org
Subject: [EXT] Re: Strange error message on unparsing ... element does not have a value

This bad message is from the deadlock detector in the unparser. It means you have a cycle in calculations so the unparser cant continue.

Looking at your schema. I see several outputValueCalc="{.}" That's a cycle immediately.
Get Outlook for Android<https://aka.ms/ghei36>

________________________________
From: Costello, Roger L. <co...@mitre.org>>
Sent: Tuesday, February 5, 2019 11:18:54 AM
To: users@daffodil.apache.org<ma...@daffodil.apache.org>
Subject: Strange error message on unparsing ... element does not have a value

Hello DFDL community,

My input file is binary, in little endian format. It contains two 2-byte values. Each value represents a hex address. My schema reverses the order of the bytes in each address. For example, with this hex input:

80 00 10 00

This is the XML that is output:


<input>
    <address1>0080</address1>
    <address2>0010</address2>
</input>

Note that the two bytes in each address are reversed.

Parsing works as desired. However, unparsing generates a strange error:

[warning] BLOCKED
exc=One(org.apache.daffodil.infoset.OutputValueCalcEvaluationException: Expression Evaluation Error: Element {}Hidden_address1_byte1 does not have a value.
Schema context: Hidden_address1_byte1
node=One(DISimple(name='Hidden_address1_byte1' contentLen(One(0)unk, One(8)unk) valueLen(One(0)unk, One(0)DOS(id=0.1))))
info=One(DPathElementCompileInfo(Hidden_address1_byte1))
index=MaybeInt(0)

Below is my schema. What am I doing wrong, please?  /Roger

<xs:element name="two-addresses">
    <xs:complexType>
        <xs:sequence>
            <xs:sequence dfdl:hiddenGroupRef="hidden_address1_Group" />
            <xs:element name="address1" type="xs:string" dfdl:inputValueCalc='{
                fn:concat(xs:string(../Hidden_address1_byte2), xs:string(../Hidden_address1_byte1))}'/>
            <xs:sequence dfdl:hiddenGroupRef="hidden_address2_Group" />
            <xs:element name="address2" type="xs:string" dfdl:inputValueCalc='{
                fn:concat(xs:string(../Hidden_address2_byte2), xs:string(../Hidden_address2_byte1))}'/>
        </xs:sequence>
    </xs:complexType>
</xs:element>

<xs:simpleType name="hexBinary1" dfdl:length="1" dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes">
    <xs:restriction base="xs:hexBinary"/>
</xs:simpleType>

<xs:group name="hidden_address1_Group">
    <xs:sequence>
        <xs:element name="Hidden_address1_byte1" type="hexBinary1" dfdl:outputValueCalc='{ . }' />
        <xs:element name="Hidden_address1_byte2" type="hexBinary1" dfdl:outputValueCalc='{ . }' />
    </xs:sequence>
</xs:group>

<xs:group name="hidden_address2_Group">
    <xs:sequence>
        <xs:element name="Hidden_address2_byte1" type="hexBinary1" dfdl:outputValueCalc='{ . }' />
        <xs:element name="Hidden_address2_byte2" type="hexBinary1" dfdl:outputValueCalc='{ . }' />
    </xs:sequence>
</xs:group>