<br><font size=2 face="sans-serif">Mike - I've combined both your replies.</font>
<br>
<br><font size=2 face="sans-serif">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? I
think top-level needs to be an element.</font>
<br>
<br><font size=2 face="sans-serif">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>
<br><font size=1 color=#800080 face="sans-serif">----- Forwarded by Steve
Hanson/UK/IBM on 20/05/2009 09:36 -----</font>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>"Mike Beckerle"
<mbeckerle.dfdl@gmail.com></b> </font>
<p><font size=1 face="sans-serif">19/05/2009 22:44</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
<mbeckerle.dfdl@gmail.com></font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">Steve Hanson/UK/IBM@IBMGB, <dfdl-wg@ogf.org></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>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2 color=blue face="Arial">I like the idea of specifying
a type for the file, instead of a distinguished top-level element.</font>
<br><font size=3> </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: 781-810-2125 | 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>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>"Mike Beckerle"
<mbeckerle.dfdl@gmail.com></b> </font>
<p><font size=1 face="sans-serif">07/05/2009 01:45</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
<mbeckerle.dfdl@gmail.com></font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">Steve Hanson/UK/IBM@IBMGB, <dfdl-wg@ogf.org></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>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2 color=blue face="Arial">Hmmm. This is the dilemma of is
an object different from an instance of its type.</font>
<br><font size=3> </font>
<br><font size=2 color=blue face="Arial">E.g., if a complex type has a
terminator is that the terminator on the element that has that type?</font>
<br><font size=3> </font>
<br><font size=2 color=blue face="Arial">We could define the syntax you
used as redundant:</font>
<br><font size=3> </font>
<br><font size=2 color=blue face="Arial"><element name="foo"
dfdl:ref="a"></font>
<br><font size=2 color=blue face="Arial"> <complexType dfdl:ref="a">
// means same thing as if also hoisted onto the element having this
type.</font>
<br><font size=2 color=blue face="Arial">
// i.e., ref applies to
scope of complexType AND to elements having this type.</font>
<br><font size=2 color=blue face="Arial"> ...</font>
<br><font size=3> </font>
<br><font size=2 color=blue face="Arial">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>
<br><font size=3> </font>
<br><font size=3> </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: 781-810-2125 | 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> </font>
<br>
<br>
<hr><font size=2 face="Tahoma"><b>From:</b> dfdl-wg-bounces@ogf.org [mailto:dfdl-wg-bounces@ogf.org]
<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>
<br><font size=2 face="sans-serif"><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. The xsd would
look like below. </font><font size=3><br>
</font><font size=2 color=#000080 face="Courier New"><br>
<xs:schema ...></font><font size=3> </font><font size=2 color=#000080 face="Courier New"><br>
</font><font size=2 color=#bfbf00 face="Courier New"><xs:annotation><xs:appinfo
source=”<i>http://www.ogf.org/dfdl/</i>”></font><font size=3> </font><font size=2 color=#000080 face="Courier New"><b><br>
</b></font><font size=2 face="Courier New"><dfdl:defineFormat
name=”textFormat1"></font><font size=3> </font><font size=2 face="Courier New"><br>
<dfdl:format encoding="utf-8"
separator="\n" representation=”text” lengthKind="delimited"
/></font><font size=3> </font><font size=2 face="Courier New"><br>
</dfdl:defineFormat></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></</b>xs:appinfo></xs:annotation></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>
<xs:element name="textDoc" </font><font size=2 face="Courier New"><b>dfdl:ref="textFormat1"
</b>dfdl:lengthKind="implicit"</font><font size=2 color=#000080 face="Courier New">></font><font size=3>
</font><font size=2 color=#000080 face="Courier New"><br>
<xs:complexType </font><font size=2 face="Courier New"><b>dfdl:ref="textFormat1"</b>></font><font size=3>
</font><font size=2 color=#800080 face="Courier New"><br>
<xs:sequence></font><font size=3>
</font><font size=2 color=#000080 face="Courier New"><br>
...</font><font size=3> </font><font size=2 color=#800080 face="Courier New"><br>
</xs:sequence></font><font size=3>
</font><font size=2 color=#000080 face="Courier New"><br>
</xs:complexType</font><font size=2 face="Courier New">></font><font size=3>
</font><font size=2 color=#000080 face="Courier New"><br>
</xs:element></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>
</xs:schema></font><font size=3> <br>
</font><font size=2 face="sans-serif"><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. </font><font size=3><br>
</font><font size=2 face="sans-serif"><br>
If this is thought to be an issue, there are a couple of options:</font><font size=3>
<br>
</font><font size=2 face="sans-serif"><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>
<br>
</font><font size=2 face="sans-serif"><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>
<br>
</font><font size=2 face="sans-serif"><br>
Any other opinions or suggestions welcome.</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><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>
<br><font size=2 face="sans-serif"><br>
</font>
<br><font size=2 face="sans-serif"><br>
</font>
<hr><font size=2 face="sans-serif"><br>
<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>
<p><font size=2 face="sans-serif"><br>
<br>
</font>
<br>
<br><font size=2 face="sans-serif"><br>
</font>