Without seeing the spec, it's hard to say. But we have seen a lot of
cases where the data in binary form is an unsigned int, but you perform
scale + offset to get it to its actual suable data.

So, in this case, you would parse an int, then scale it by 0.01. We
usually do something like this:

<xs:element name="Azimuth>
  <xs:complexType>
    <xs:sequence>
      <xs:element name="raw" type="xs:unsignedInt" ...
        dfdl:outputValueCalc="{ xs:unisngedInt(../mils div 0.01 }" />
      <xs:element name="mils" type="xs:double"
        dfdl:inputValueCalc="{ xs:double(../raw * 0.01) }" />
    </xs:sequence>
  </xs:complexType>
</xs:element>

The inputValueCalc and outputValueCalc properties are used to to scale
the values using the scale factor. You might also want to put a
restriction on the "mils" element to make sure it's in the correct range
when validation is enabled.

On 6/19/19 11:19 AM, Costello, Roger L. wrote:
> Hello DFDL community,
> 
> I am implementing a DFDL schema for a specification which says this about an 
> input field:
> 
> Name: Azimuth
> Type: Int32
> Units: mils
> Range: 0 - 6399.99
> Scale: 0.01
> 
> I think that means the input field can have any value from 0.00 to 6399.99 
> ... do you agree?
> 
> The type Int32 confuses me. Doesn't Int32 mean "32-bit integer"? But I 
> thought the field contains a decimal, not an integer? 
> 
> I want to create a sample binary input file. What is the hex value of, say, 
> 6399.99?
> 
> /Roger
> 

Reply via email to