<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16825" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=796074200-07052009><FONT face=Arial
color=#0000ff size=2>Hmmm. This is the dilemma of is an object different from an
instance of its type.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=796074200-07052009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=796074200-07052009><FONT face=Arial
color=#0000ff size=2>E.g., if a complex type has a terminator is that the
terminator on the element that has that type?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=796074200-07052009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=796074200-07052009><FONT face=Arial
color=#0000ff size=2>We could define the syntax you used as
redundant:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=796074200-07052009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=796074200-07052009><FONT face=Arial
color=#0000ff size=2><element name="foo" dfdl:ref="a"></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=796074200-07052009><FONT face=Arial
color=#0000ff size=2> <complexType dfdl:ref="a"> //
means same thing as if also hoisted onto the element having this
type.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=796074200-07052009><FONT face=Arial
color=#0000ff
size=2>
// i.e., ref applies to scope of complexType AND to elements having this
type.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=796074200-07052009><FONT face=Arial
color=#0000ff size=2> ...</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=796074200-07052009><FONT face=Arial color=#0000ff size=2>It is
true we do not allow dfdl:ref on the xs:schema element. This is for very
important reasons of keeping us out of the whole lexical vs. non-lexical scoping
morass. Let's not go there. </FONT></SPAN></DIV>
<DIV><SPAN class=796074200-07052009><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=796074200-07052009><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<P align=left><A name=""></A><?xml:namespace prefix = st1 ns =
"urn:schemas-microsoft-com:office:smarttags" /><st1:PersonName w:st="on"><SPAN
style="mso-bookmark: ''"><B><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></B></SPAN></st1:PersonName><SPAN
style="mso-bookmark: ''"><B><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Mike Beckerle |
OGF DFDL WG Co-Chair | CTO | Oco, Inc.</SPAN></B></SPAN><BR><SPAN
style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Arial">Tel:
781-810-2125 | <st1:address w:st="on"><st1:Street w:st="on">100 Fifth
Ave., 4th Floor</st1:Street>, <st1:City w:st="on">Waltham</st1:City> <st1:State
w:st="on">MA</st1:State> <st1:PostalCode
w:st="on">02451</st1:PostalCode></st1:address> |</SPAN> <A
href="mailto:mbeckerle.dfdl@gmail.com"><SPAN
style="FONT-SIZE: 10pt; COLOR: gray"><FONT
face=Arial>mbeckerle.dfdl@gmail.com</FONT></SPAN></A><SPAN
style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Arial"> </SPAN></P>
<DIV> </DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> dfdl-wg-bounces@ogf.org
[mailto:dfdl-wg-bounces@ogf.org] <B>On Behalf Of </B>Steve
Hanson<BR><B>Sent:</B> Wednesday, May 06, 2009 1:22 PM<BR><B>To:</B>
dfdl-wg@ogf.org<BR><B>Subject:</B> [DFDL-WG] DFDL: Applying DFDL annotations to
elements<BR></FONT><BR></DIV>
<DIV></DIV><BR><FONT face=sans-serif size=2>To apply DFDL annotations to a
top-level element in a DFDL xsd, most modellers would use the dfdl:element
dfdl:ref property to refer to a named dfdl:defineFormat block that set up the
necessary defaults for all the DFDL properties. To avoid having to re-state the
dfdl:ref property on every object that comprises the format, most modellers
would also use the dfdl:complexType dfdl:ref property to scope the same
dfdl:defineFormat block. The xsd would look like below.
</FONT><BR><BR><FONT face="Courier New" color=#000080 size=2><xs:schema
...></FONT> <BR><FONT face="Courier New" color=#000080 size=2>
</FONT><FONT face="Courier New" color=#bfbf00
size=2><xs:annotation><xs:appinfo
source=”<I>http://www.ogf.org/dfdl/</I>”></FONT> <BR><FONT face="Courier New"
color=#000080 size=2><B> </B></FONT><FONT face="Courier New"
size=2><dfdl:defineFormat name=”textFormat1"></FONT> <BR><FONT
face="Courier New" size=2> <dfdl:format
encoding="utf-8" separator="\n" representation=”text” lengthKind="delimited"
/></FONT> <BR><FONT face="Courier New" size=2>
</dfdl:defineFormat></FONT> <BR><FONT face="Courier New" color=#000080
size=2><B> </B></FONT><FONT face="Courier New" color=#bfbf00
size=2><B></</B>xs:appinfo></xs:annotation></FONT> <BR><FONT
face="Courier New" color=#000080 size=2> ...</FONT> <BR><FONT
face="Courier New" color=#000080 size=2> <xs:element name="textDoc"
</FONT><FONT face="Courier New" size=2><B>dfdl:ref="textFormat1"
</B>dfdl:lengthKind="implicit"</FONT><FONT face="Courier New" color=#000080
size=2>></FONT> <BR><FONT face="Courier New" color=#000080 size=2>
<xs:complexType </FONT><FONT
face="Courier New" size=2><B>dfdl:ref="textFormat1"</B>></FONT> <BR><FONT
face="Courier New" color=#800080 size=2>
<xs:sequence></FONT> <BR><FONT face="Courier New"
color=#000080 size=2> ...</FONT>
<BR><FONT face="Courier New" color=#800080 size=2>
</xs:sequence></FONT> <BR><FONT
face="Courier New" color=#000080 size=2>
</xs:complexType</FONT><FONT face="Courier New" size=2>></FONT>
<BR><FONT face="Courier New" color=#000080 size=2>
</xs:element></FONT> <BR><FONT face="Courier New" color=#000080
size=2> ...</FONT> <BR><FONT face="Courier New" color=#000080
size=2></xs:schema></FONT> <BR><BR><FONT face=sans-serif size=2>It's not
possible to put DFDL defaults in scope for the whole format with a single
dfdl:ref property. I think this is a side-effect of removing the dfdl:appliesTo
property. </FONT><BR><BR><FONT face=sans-serif size=2>If this is thought to be
an issue, there are a couple of options:</FONT> <BR><BR><FONT face=sans-serif
size=2>One is to say that a complex type can be the top-level object. This is
the case with several XML based systems. It works with XML because the XML
instance document provides the name of top level element in the infoset via its
tag. This is not the case with DFDL where the name is commonly not carried with
the format. So we'd have no name for the infoset.</FONT> <BR><BR><FONT
face=sans-serif size=2>Another is to provide a new property on
dfdl:defineFormat, which says this dfdl:defineFormat is the default for all
top-level objects in the xsd. Any top-level object that remained silent as to
its dfdl:ref would get the default applied. I'm not sure whether this makes the
model too opaque though. No more so than the existing scoping rules, I
suspect.</FONT> <BR><BR><FONT face=sans-serif size=2>Any other opinions or
suggestions welcome.</FONT> <BR><BR><FONT face=sans-serif
size=2>Regards<BR><BR>Steve Hanson<BR>Programming Model Architect<BR>WebSphere
Message Brokers<BR>Hursley, UK<BR>Internet: smh@uk.ibm.com<BR>Phone (+44)/(0)
1962-815848<BR></FONT><BR><FONT face=sans-serif size=2><BR></FONT>
<HR>
<FONT face=sans-serif size=2><BR><I><BR></I></FONT>
<P><FONT face=sans-serif size=2><I>Unless stated otherwise above:<BR>IBM United
Kingdom Limited - Registered in England and Wales with number 741598.
<BR>Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU</I></FONT>
<P><FONT face=sans-serif size=2><BR><BR></FONT><BR><BR><FONT face=sans-serif
size=2><BR></FONT></P></BODY></HTML>