<br><font size=2 face="sans-serif">I tend to agree top level has to be
element.. I recall we had the option of putting a format to use at schema
level which would apply to all top level elements defined in the schema..</font>
<br><font size=2 face="sans-serif"><br>
Suman Kalia<br>
IBM Toronto Lab<br>
WMB Toolkit Architect and Development Lead<br>
WebSphere Business Integration Application Connectivity Tools <br>
<br>
</font><a href=http://www.ibm.com/developerworks/websphere/zones/businessintegration/wmb.html><font size=2 face="sans-serif">http://www.ibm.com/developerworks/websphere/zones/businessintegration/wmb.html</font></a><font size=2 face="sans-serif"><br>
<br>
Tel : 905-413-3923 &nbsp;T/L &nbsp;969-3923<br>
Fax : 905-413-4850 T/L &nbsp;969-4850<br>
Internet ID : kalia@ca.ibm.com</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">From:</font>
<td><font size=1 face="sans-serif">Steve Hanson &lt;smh@uk.ibm.com&gt;</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">To:</font>
<td><font size=1 face="sans-serif">&lt;mbeckerle.dfdl@gmail.com&gt;</font>
<tr>
<td valign=top><font size=1 color=#5f5f5f face="sans-serif">Cc:</font>
<td><font size=1 face="sans-serif">dfdl-wg@ogf.org</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Date:</font>
<td><font size=1 face="sans-serif">05/20/2009 08:36 AM</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Subject:</font>
<td><font size=1 face="sans-serif">Re: [DFDL-WG] DFDL: Applying DFDL annotations
to elements</font></table>
<br>
<hr noshade>
<br>
<br>
<br><font size=2 face="sans-serif"><br>
Mike - I've combined both your replies.</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
But if you specify a type instead of an element, how do you define a lengthKind
for the structure (sequence can't carry it any more) and what name do you
use in the infoset? &nbsp;I think top-level needs to be an element.</font><font size=3>
<br>
</font><font size=2 face="sans-serif"><br>
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</font><font size=3> </font><font size=1 color=#800080 face="sans-serif"><br>
----- Forwarded by Steve Hanson/UK/IBM on 20/05/2009 09:36 -----</font><font size=3>
</font>
<table width=100%>
<tr valign=top>
<td width=43%><font size=1 face="sans-serif"><b>&quot;Mike Beckerle&quot;
&lt;mbeckerle.dfdl@gmail.com&gt;</b> </font>
<p><font size=1 face="sans-serif">19/05/2009 22:44</font><font size=3>
</font>
<br>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
&lt;mbeckerle.dfdl@gmail.com&gt;</font></div></table>
<p>
<td width=56%>
<table width=100%>
<tr valign=top>
<td width=11%>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td width=88%><font size=1 face="sans-serif">Steve Hanson/UK/IBM@IBMGB,
&lt;dfdl-wg@ogf.org&gt;</font><font size=3> </font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">RE: [DFDL-WG] DFDL: Applying DFDL annotations
to elements</font></table>
<br>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br><font size=3><br>
<br>
</font><font size=2 color=blue face="Arial"><br>
I like the idea of specifying a type for the file, instead of a distinguished
top-level &nbsp;element.</font><font size=3> <br>
 &nbsp;</font>
<p><font size=2 color=#000080 face="Arial"><b>Mike Beckerle | OGF DFDL
WG Co-Chair | CTO | Oco, Inc.</b></font><font size=2 color=#808080 face="Arial"><br>
Tel: &nbsp;781-810-2125 &nbsp;| 100 Fifth Ave., 4th Floor, Waltham MA 02451
|</font><font size=3> </font><a href=mailto:mbeckerle.dfdl@gmail.com><font size=2 color=#808080 face="Arial"><u>mbeckerle.dfdl@gmail.com</u></font></a><font size=2 color=#808080 face="Arial">
</font><font size=3><br>
<br>
</font>
<table width=100%>
<tr valign=top>
<td width=43%><font size=1 face="sans-serif"><b>&quot;Mike Beckerle&quot;
&lt;mbeckerle.dfdl@gmail.com&gt;</b> </font>
<p><font size=1 face="sans-serif">07/05/2009 01:45</font><font size=3>
</font>
<br>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
&lt;mbeckerle.dfdl@gmail.com&gt;</font></div></table>
<p>
<td width=56%>
<table width=100%>
<tr valign=top>
<td width=11%>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td width=88%><font size=1 face="sans-serif">Steve Hanson/UK/IBM@IBMGB,
&lt;dfdl-wg@ogf.org&gt;</font><font size=3> </font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">RE: [DFDL-WG] DFDL: Applying DFDL annotations
to elements</font></table>
<br>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br><font size=3><br>
<br>
</font><font size=2 color=blue face="Arial"><br>
Hmmm. This is the dilemma of is an object different from an instance of
its type.</font><font size=3> <br>
 &nbsp;</font><font size=2 color=blue face="Arial"><br>
E.g., if a complex type has a terminator is that the terminator on the
element that has that type?</font><font size=3> <br>
 &nbsp;</font><font size=2 color=blue face="Arial"><br>
We could define the syntax you used as redundant:</font><font size=3> <br>
 &nbsp;</font><font size=2 color=blue face="Arial"><br>
&lt;element name=&quot;foo&quot; dfdl:ref=&quot;a&quot;&gt;</font><font size=3>
</font><font size=2 color=blue face="Arial"><br>
 &nbsp; &lt;complexType dfdl:ref=&quot;a&quot;&gt; &nbsp;// means same
thing as if also hoisted onto the element having this type.</font><font size=3>
</font><font size=2 color=blue face="Arial"><br>
 &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><font size=3> </font><font size=2 color=blue face="Arial"><br>
 &nbsp; &nbsp; ...</font><font size=3> <br>
 &nbsp;</font><font size=2 color=blue face="Arial"><br>
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><font size=3><br>
 &nbsp;<br>
 &nbsp;</font>
<p><font size=2 color=#000080 face="Arial"><b>Mike Beckerle | OGF DFDL
WG Co-Chair | CTO | Oco, Inc.</b></font><font size=2 color=#808080 face="Arial"><br>
Tel: &nbsp;781-810-2125 &nbsp;| 100 Fifth Ave., 4th Floor, Waltham MA 02451
|</font><font size=3> </font><a href=mailto:mbeckerle.dfdl@gmail.com><font size=2 color=#808080 face="Arial"><u>mbeckerle.dfdl@gmail.com</u></font></a><font size=2 color=#808080 face="Arial">
</font>
<p><font size=3>&nbsp; <br>
<br>
</font>
<hr><font size=2 face="Tahoma"><b>From:</b> dfdl-wg-bounces@ogf.org [</font><a href="mailto:dfdl-wg-bounces@ogf.org"><font size=2 face="Tahoma">mailto:dfdl-wg-bounces@ogf.org</font></a><font size=2 face="Tahoma">]
<b>On Behalf Of </b>Steve Hanson<b><br>
Sent:</b> Wednesday, May 06, 2009 1:22 PM<b><br>
To:</b> dfdl-wg@ogf.org<b><br>
Subject:</b> [DFDL-WG] DFDL: Applying DFDL annotations to elements</font><font size=3><br>
</font><font size=2 face="sans-serif"><br>
<br>
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><font size=2 color=#000080 face="Courier New"><br>
<br>
&lt;xs:schema ...&gt;</font><font size=3> </font><font size=2 color=#000080 face="Courier New"><br>
 </font><font size=2 color=#bfbf00 face="Courier New">&lt;xs:annotation&gt;&lt;xs:appinfo
source=”</font><a href=http://www.ogf.org/dfdl/><font size=2 color=#bfbf00 face="Courier New"><i>http://www.ogf.org/dfdl/</i></font></a><font size=2 color=#bfbf00 face="Courier New">”&gt;</font><font size=3>
</font><font size=2 color=#000080 face="Courier New"><b><br>
 &nbsp; &nbsp; </b></font><font size=2 face="Courier New">&lt;dfdl:defineFormat
name=”textFormat1&quot;&gt;</font><font size=3> </font><font size=2 face="Courier New"><br>
 &nbsp; &nbsp; &nbsp; &lt;dfdl:format encoding=&quot;utf-8&quot; separator=&quot;\n&quot;
representation=”text” lengthKind=&quot;delimited&quot; /&gt;</font><font size=3>
</font><font size=2 face="Courier New"><br>
 &nbsp; &nbsp; &lt;/dfdl:defineFormat&gt;</font><font size=3> </font><font size=2 color=#000080 face="Courier New"><b><br>
 </b></font><font size=2 color=#bfbf00 face="Courier New"><b>&lt;/</b>xs:appinfo&gt;&lt;/xs:annotation&gt;</font><font size=3>
</font><font size=2 color=#000080 face="Courier New"><br>
 ...</font><font size=3> </font><font size=2 color=#000080 face="Courier New"><br>
 &lt;xs:element name=&quot;textDoc&quot; </font><font size=2 face="Courier New"><b>dfdl:ref=&quot;textFormat1&quot;
</b>dfdl:lengthKind=&quot;implicit&quot;</font><font size=2 color=#000080 face="Courier New">&gt;</font><font size=3>
</font><font size=2 color=#000080 face="Courier New"><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;xs:complexType </font><font size=2 face="Courier New"><b>dfdl:ref=&quot;textFormat1&quot;</b>&gt;</font><font size=3>
</font><font size=2 color=#800080 face="Courier New"><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;xs:sequence&gt;</font><font size=3>
</font><font size=2 color=#000080 face="Courier New"><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ...</font><font size=3> </font><font size=2 color=#800080 face="Courier New"><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/xs:sequence&gt;</font><font size=3>
</font><font size=2 color=#000080 face="Courier New"><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/xs:complexType</font><font size=2 face="Courier New">&gt;</font><font size=3>
</font><font size=2 color=#000080 face="Courier New"><br>
 &lt;/xs:element&gt;</font><font size=3> </font><font size=2 color=#000080 face="Courier New"><br>
 ...</font><font size=3> </font><font size=2 color=#000080 face="Courier New"><br>
&lt;/xs:schema&gt;</font><font size=3> </font><font size=2 face="sans-serif"><br>
<br>
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. <br>
<br>
If this is thought to be an issue, there are a couple of options:</font><font size=3>
</font><font size=2 face="sans-serif"><br>
<br>
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><font size=3>
</font><font size=2 face="sans-serif"><br>
<br>
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><font size=3>
</font><font size=2 face="sans-serif"><br>
<br>
Any other opinions or suggestions welcome.</font><font size=3> </font><font size=2 face="sans-serif"><br>
<br>
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><font size=3><br>
<br>
</font>
<hr>
<p><font size=2 face="sans-serif"><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><font size=3> </font>
<p><font size=3><br>
<br>
</font><font size=2 face="sans-serif"><br>
</font><font size=3><br>
</font><font size=2 face="sans-serif"><br>
</font><font size=3><br>
</font><font size=2 face="sans-serif"><br>
</font><font size=3><br>
</font>
<hr><font size=2 face="sans-serif"><i><br>
</i></font>
<p><font size=2 face="sans-serif"><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><font size=3> </font>
<p><font size=2 face="sans-serif"><br>
</font><font size=3><br>
<br>
</font><font size=2 face="sans-serif"><br>
</font><tt><font size=2>--<br>
 &nbsp;dfdl-wg mailing list<br>
 &nbsp;dfdl-wg@ogf.org<br>
 &nbsp;</font></tt><a href="http://www.ogf.org/mailman/listinfo/dfdl-wg"><tt><font size=2>http://www.ogf.org/mailman/listinfo/dfdl-wg</font></tt></a>
<p>
<p>