I have a question for more experienced Daffodil maintainers.  Suppose a schema 
contains some fixed="constant" attributes:

  <xs:complexType name="Limits">
    <xs:sequence>
      <xs:element name="sync0" fixed="210" type="idl:uint8"/>
      <xs:element name="sync1" fixed="13" type="idl:uint8"/>
      <xs:element name="id" fixed="34" type="idl:uint8"/>
      <xs:element name="length" fixed="0" type="idl:uint8"/>
      <xs:element name="checksum" type="idl:uint16"/>
    </xs:sequence>
  </xs:complexType>
  <xs:element name="LimitsDecl" type="idl:Limits"/> 
</xs:schema>

If a TDML test suite turns on validation="on", Daffodil runtime1 will call 
Xerces to perform validation on an XML infoset and Xerces will report a 
validation error if, say, element sync0 does not contain the right value:

[Fail] limits_parse
  Failure Information:
    (Implementation: daffodil) Validation errors found where none were expected 
by the test case.
    Validation Error: cvc-elt.5.2.2.2.2: The value '208' of element 'sync0' 
does not match the {value constraint} value '210'.

I want Daffodil runtime2 to detect the presence of a fixed="constant" attribute 
on a schema grammar object and generate C code to check that the corresponding 
C struct member contains the right value.  However, I don't know how to write 
code to find the "fixed" attribute on a schema grammar object when runtime2 
calls a class like BinaryIntegerKnownLengthCodeGenerator.   I set a breakpoint 
in the debugger but a quick search found the fixed attribute only in a shareKey 
value.  

How can I detect the presence of the fixed attribute and get its value in 
BinaryIntegerKnownLengthCodeGenerator?

John

Reply via email to