THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block |
---|
<xs:simpleType name="fruitLocalType" dfdlx:inputValueCalc ="{ dfdlx:repTypeValuerepTypeValueInt() – 2 }" dfdlx:ouputValueCalc ="{ dfdlx:logicalTypeValuelogicalTypeValueInt() + 2 }" dfdlx:repType=”tns:fruitIntType” dfdlx:repValues="12 14" dfdlx:repValueRanges="3 10 16 255" > <xs:restriction base=”xs:int” /> </xs:simpleType> |
...
Code Block |
---|
<xs:simpleType name="fruitLocalType" dfdlx:inputTransform="dfdlx:repTypeValuerepTypeValueInt() - 2" dfdlx:outputTransform="dfdlx:logicalTypeValuelogicalTypeValueInt() + 2" dfdlx:repValues="12 14" dfdlx:repValueRanges="3 10 16 255" > <xs:union> <xs:simpleType> <xs:restriction base="xs:int "> <xs:enumeration value="10"/> <xs:enumeration value="12"/> </xs:restriction> </xs:simpleType> <xs:simpleType> <xs:restriction base="xs:int"> <xs:minInclusive="1"/> <xs:maxInclusive="8"/> </xs:restriction> </xs:simpleType> <xs:simpleType> <xs:restriction base="xs:int"> <xs:minInclusive="14"/> <xs:maxInclusive="253"/> </xs:restriction> </xs:simpleType> </xs:union> </xs:simpleType> |
...
- dfdlx:inputTypeCalc
- Applies to xs:simpleType
- Requires dfdlx:repType to also be present
- Is a DFDL expression
- On parse, first parse according to the repType, then populate the value of this element to the result of evaluating the dfdlx:inputTypeCalc expression
- The value of the repType may be accessed by the expression through the dfdlx:repTypeValue() functionrepTypeValue functions
- dfdlx:ouputTypeCalc
- Applies to xs:simpleType
- Requires dfdlx:repType to also be present
- Is a DFDL expression
- On unparse, first evaluate this expression, then unparse according to the repType as if the logical value were the result of evaluating this expression
- The original logical value of this type may be accessed by the expression through the dfdlx:logicalTypeValue() functionlogicalTypeValue functions
- dfdlx:repValues
- Applies to xs:enumeration and xs:simpleType
- A space separated list of values
- Values must be of a type consistend with repType
- When applied to xs:enumeration:
- Defines a KeySet-Value transform, and associates the annotated enumeration value with the listed keys
- Adds the listed values to the repValue set of the parent simpleType
- When Applied to xs:simpleType
- Adds the listed keys to the repValue set of the parent
- This set will be used by xs:choice when choiceBranchKeyKind=byType
- dfdlx:repValueRanges
- Applies to xs:enumeration and xs:simpleType
- Requires dfdlx:repType to be present and refer to an integer type
- A space separated list of integers defining ranges of integers
- Takes the form “min1 max1 min2 max2 … minN maxN”
- Represents the set of integers described by the union of the intervals [mink, maxK]
- Behaves as if all members of this set were included in the dfdlx:repValues annotation
...
- dfdlx:inputTypeCalcInt(f: QName, x:Any)
- f must be a constant QName resolving to a simpleType with a transform defined
- The repType of said transform must match the type of x
- The type f must be a restriction of xs:int
- Returns the result of applying the inputTypeCalc function assotiated with f to x
- dfdlx:inputTypeCalcString(f: QName, x:Any)
- Behaves like dfdlx:inputTypeCalcInt(f: QName, x:Any) except that f must be a string type, and a string will be returned
- dfdlx:outputTypeCalcInt(f: QName, x:Any)
- f must be a constant QName resolving to a simpleType with a transform defined
- The repType of said transform must be a restriction of xs:int
- The type f must match the type of x
- Returns the result of applying the outputTypeCalc function assotiated with f to x
- dfdlx:outputTypeCalcString(f: QName, x:Any)
- Behaves like dfdlx:inputTypeCalcInt(f: QName, x:Any) except that the repType associated with f must be a restriction of xs:string, and a string will be returned
- dfdlx:outputTypeCalcNextSiblingInt(f: QName, x:Any)
- The following sibling must be a simpleType whose repType is a restriction of xs:int
- Returns the result of applying the outputTypeCalc function associated with the type of the following element to the value of the following element
- dfdlx:outputTypeCalcNextSiblingString()
- Behaves like dfdlx:outputTypeCalcNextSiblingInt, except the repType must be a restriction of xs:string, and a string will be returned
- dfdlx:repTypeValuerepTypeValueInt()
- Can only be called from inside dfdlx:inputTransform
- Returns the value of the underlying repType, wehn the underlying repType has an int value
- dfdlx:repTypeValueString()
- Can only be called from inside dfdlx:inputTransform
- Returns the value of the underlying repType, wehn the underlying repType has an string value
- dfdlx:logicalTypeValueInt()
- Can only be called from inside dfdlx:outputTransform
- Returns the logical value of this element when the logical type is an int type.
- dfdlx:logicalTypeValueString()dfdlx:logicalTypeValue
- Can only be called from inside dfdlx:outputTransform
- Returns the logical value of this element when the logical type is a String type.