<!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>&nbsp;</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>&nbsp;</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>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=796074200-07052009><FONT face=Arial 
color=#0000ff size=2>&lt;element name="foo" dfdl:ref="a"&gt;</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=796074200-07052009><FONT face=Arial 
color=#0000ff size=2>&nbsp;&nbsp; &lt;complexType dfdl:ref="a"&gt;&nbsp; // 
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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
// 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>&nbsp;&nbsp;&nbsp;&nbsp; ...</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</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>&nbsp;</DIV>
<DIV><SPAN class=796074200-07052009><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</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&nbsp;| 
OGF DFDL WG Co-Chair | CTO | Oco, Inc.</SPAN></B></SPAN><BR><SPAN 
style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Arial">Tel:&nbsp; 
781-810-2125&nbsp; | <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">&nbsp;</SPAN></P>
<DIV>&nbsp;</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. &nbsp;The xsd would look like below. 
</FONT><BR><BR><FONT face="Courier New" color=#000080 size=2>&lt;xs:schema 
...&gt;</FONT> <BR><FONT face="Courier New" color=#000080 size=2>&nbsp; 
</FONT><FONT face="Courier New" color=#bfbf00 
size=2>&lt;xs:annotation&gt;&lt;xs:appinfo 
source=&#8221;<I>http://www.ogf.org/dfdl/</I>&#8221;&gt;</FONT> <BR><FONT face="Courier New" 
color=#000080 size=2><B>&nbsp; &nbsp; &nbsp; </B></FONT><FONT face="Courier New" 
size=2>&lt;dfdl:defineFormat name=&#8221;textFormat1"&gt;</FONT> <BR><FONT 
face="Courier New" size=2>&nbsp; &nbsp; &nbsp; &nbsp; &lt;dfdl:format 
encoding="utf-8" separator="\n" representation=&#8221;text&#8221; lengthKind="delimited" 
/&gt;</FONT> <BR><FONT face="Courier New" size=2>&nbsp; &nbsp; &nbsp; 
&lt;/dfdl:defineFormat&gt;</FONT> <BR><FONT face="Courier New" color=#000080 
size=2><B>&nbsp; </B></FONT><FONT face="Courier New" color=#bfbf00 
size=2><B>&lt;/</B>xs:appinfo&gt;&lt;/xs:annotation&gt;</FONT> <BR><FONT 
face="Courier New" color=#000080 size=2>&nbsp; ...</FONT> <BR><FONT 
face="Courier New" color=#000080 size=2>&nbsp; &lt;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>&gt;</FONT> <BR><FONT face="Courier New" color=#000080 size=2>&nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;xs:complexType </FONT><FONT 
face="Courier New" size=2><B>dfdl:ref="textFormat1"</B>&gt;</FONT> <BR><FONT 
face="Courier New" color=#800080 size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp;&lt;xs:sequence&gt;</FONT> <BR><FONT face="Courier New" 
color=#000080 size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ...</FONT> 
<BR><FONT face="Courier New" color=#800080 size=2>&nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp;&lt;/xs:sequence&gt;</FONT> <BR><FONT 
face="Courier New" color=#000080 size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp;&lt;/xs:complexType</FONT><FONT face="Courier New" size=2>&gt;</FONT> 
<BR><FONT face="Courier New" color=#000080 size=2>&nbsp; 
&lt;/xs:element&gt;</FONT> <BR><FONT face="Courier New" color=#000080 
size=2>&nbsp; ...</FONT> <BR><FONT face="Courier New" color=#000080 
size=2>&lt;/xs:schema&gt;</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>