The input field is fixed length (3). Its content is a right-aligned decimal 
value. Here are several legal inputs:

1.2
.12
12.
123
  1 (two spaces before the 1)
12 (one space before 12)

The field name is "num". How to declare num?

I tried this and it doesn't work:

<xs:element name="num" type="decimal-3-chars"/>

<xs:simpleType name="decimal-3-chars"
                          dfdl:lengthKind="explicit"
                          dfdl:length="3"
                          dfdl:textNumberCheckPolicy="lax"
                          dfdl:textNumberPattern="000"
                          dfdl:textNumberRep="standard"
                          dfdl:textNumberRounding="explicit"
                          dfdl:textNumberRoundingMode="roundUnnecessary"
                          dfdl:textOutputMinLength="0"
                          dfdl:textPadKind="padChar"
                          dfdl:textNumberPadCharacter="0"
                          dfdl:textNumberJustification="right"
                          dfdl:textStandardBase="10"
                          dfdl:textStandardDecimalSeparator="." >
    <xs:annotation>
        <xs:appinfo source=http://www.ogf.org/dfdl/>
            <dfdl:assert testKind="expression"
                                test="{dfdl:checkConstraints(.)}"
                                message="invalid decimal-3-chars"
                                failureType="processingError"/>
        </xs:appinfo>
    </xs:annotation>
    <xs:restriction base="xs:decimal">
        <xs:totalDigits value="3"/>
        <xs:minInclusive value="0"/>
        <xs:maxInclusive value="999"/>
    </xs:restriction>
</xs:simpleType>

Reply via email to