[dfdl-wg] alternate syntax for DFDL annotations

Myers, James D jim.myers at pnl.gov
Wed Mar 2 11:35:33 CST 2005


I agree - I think I like #2. I know at one point in the past we had
complaints when we tried to use attributes with namespaces - it may just
have been that parsers weren't dealing with them correctly early on.
Whatever it was, option 2 would provide a work around as well as helping
us keep a single 'canonical' form for DFDL.

 Jim

> -----Original Message-----
> From: owner-dfdl-wg at ggf.org [mailto:owner-dfdl-wg at ggf.org] On 
> Behalf Of Martin Westhead
> Sent: Wednesday, March 02, 2005 12:16 PM
> To: Mike Beckerle
> Cc: dfdl-wg at gridforum.org
> Subject: Re: [dfdl-wg] alternate syntax for DFDL annotations
> 
> 
> 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
> >  
> 
> 





More information about the dfdl-wg mailing list