alternate syntax for DFDL annotations

Up til now we've considered DFDL annotations only as inside the appinfo context. However, we should consider whether we should use non-native attributes as well or as an alternative: E.g., simple DFDL rep properties could also be expressed like this: <xs:element name="foo" type="xs:string" dfdl:repType="text" dfdl:charset="UTF-8" dfdl:repLength="10"/> This has the advantages of compactness, and is a fully supported way of extending XML Schema. That is, using non-native attributes is a supported extension idiom. This won't handle things that really need the syntactic support of element structure to express their complexity, e.g., things like specifying text delimiters with quoting and escape-sequence specifications. For those we'll still need to open an appinfo annotation up. However, for basic things like byteOrder and such it is far more attractive syntactically to use non-native attributes than appinfo annotations. Comments? ...mikeb

Hi Mike, This is interesting I wasn't aware you could do this. My concern would be if it turned out the schema tools couldn't handle it but I tried XML Spy which seems to just ignore the extra annotations. So I'd be happy to use them. As you point out we will need both these and annotations so we are left with a choice. Either we: 1. Specify some (most) dfdl additions in this non-native attribute form and use annotations when required or 2. We specify everything as annotations but allow this form as a systematic short hand. I think I prefer (2). The sort of thing I have in mind is making the annotation syntax look like: <xs:element name="foo" type="xs:string"> <annotation> <appinfo> <dfdl:attributes dfdl:repType="text" dfdl:charset="UTF-8" dfdl:repLength="10"/> </appinfo> <annotation </xs:element> And then this be directly equivalent (and trivially transformed into/from) what you had before: <xs:element name="foo" type="xs:string" dfdl:repType="text" dfdl:charset="UTF-8" dfdl:repLength="10"/> I'm not sure if it matters that much but it seems like it might be neater if everything could be represented in the same form. Also there may be times when you would like to use the annotation form because you have a bock of stuff that could be reused multiple times. Once your annotations have become attributes in the main schema they are more intimately tied to it. Cheers, Martin Mike Beckerle wrote:
Up til now we've considered DFDL annotations only as inside the appinfo context. However, we should consider whether we should use non-native attributes as well or
as an alternative: E.g., simple DFDL rep properties could also be expressed like this:
<xs:element name="foo"
type="xs:string"
dfdl:repType="text"
dfdl:charset="UTF-8"
dfdl:repLength="10"/>
This has the advantages of compactness, and is a fully supported way of extending XML Schema. That is, using non-native attributes is a supported extension idiom. This won't handle things that really need the syntactic support of element structure to express their complexity, e.g., things like specifying text delimiters with quoting and escape-sequence specifications. For those we'll still need to open an appinfo annotation up. However, for basic things like byteOrder and such it is far more attractive syntactically to use non-native attributes than appinfo annotations.
Comments?
...mikeb
participants (2)
-
Martin Westhead
-
Mike Beckerle