HI,
I am currently working on a first code-generator for my DFDL schemas … as
implementing the full spec is completely out of question as it’s just far to
feature-rich and hereby complex to implement, I am currently refactoring my
schemas to allow everything I need, but as simple as possible. While I was able
to come up with solutions for most things, one thing is a little annoying:
We have an element like this:
<xs:element name="data" type="xs:hexBinary"
dfdl:byteOrder="bigEndian" dfdl:lengthUnits="bytes"
dfdl:lengthKind="explicit"
dfdl:length="{../../parameterLength}"/>
We moved the definition of all types to the top in “simpleType” elements and
simply reference “plc4x:uint8” for example, however we can’t do that with these
as we can’t override the “length” later on …
I would have preferred something like this:
<xs:simpleType name="data" dfdl:lengthUnits="bytes" dfdl:length="1"
dfdl:lengthKind="explicit">
<xs:restriction base="xs:hexBinary"/>
</xs:simpleType>
And then override the length where needed:
<xs:element name="data" type="plc4x:data"
dfdl:length="{../../parameterLength}"/>
Are there any options to do such a thing and I just haven’t found them yet?
Chris