<!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=187224621-19052009><FONT face=Arial 
color=#0000ff size=2>To me, no properties apply to a complex type, rather they 
apply to the model group (sequence or choice) which is the meaning of the 
complex type.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=187224621-19052009><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=187224621-19052009><FONT face=Arial 
color=#0000ff size=2>That is, we don't have to distinguish a complex type from 
the model group that defines it. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=187224621-19052009><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=187224621-19052009><FONT face=Arial 
color=#0000ff size=2>...mike</FONT></SPAN></DIV>
<DIV>&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> Alan Powell 
[mailto:alan_powell@uk.ibm.com] <BR><B>Sent:</B> Tuesday, May 19, 2009 11:50 
AM<BR><B>To:</B> mbeckerle.dfdl@gmail.com<BR><B>Cc:</B> dfdl-wg@ogf.org; 
dfdl-wg-bounces@ogf.org<BR><B>Subject:</B> Re: [DFDL-WG] Grammar issue - simple 
and complex asymetry<BR></FONT><BR></DIV>
<DIV></DIV><BR><FONT face=sans-serif size=2>Mike</FONT> <BR><BR><FONT 
face=sans-serif size=2>That looks reasonable.</FONT> <BR><BR><FONT 
face=sans-serif size=2>However as you must still be able to specify 
dfdl:initiator/terminator on the complexType for scoping we need to somehow make 
it clear that the grammar describes where the properties APPLY not where they 
are SPECIFIED. </FONT><BR><BR><FONT face=sans-serif size=2>Do any properties 
APPLY to a complexType?</FONT> <BR><FONT face=sans-serif size=2><BR>Alan 
Powell<BR><BR>MP 211, IBM UK Labs, Hursley, &nbsp;Winchester, SO21 2JN, 
England<BR>Notes Id: Alan Powell/UK/IBM &nbsp; &nbsp; email: 
alan_powell@uk.ibm.com &nbsp;<BR>Tel: +44 (0)1962 815073 &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Fax: +44 (0)1962 
816898<BR></FONT><BR><BR><BR>
<TABLE width="100%">
  <TBODY>
  <TR vAlign=top>
    <TD><FONT face=sans-serif color=#5f5f5f size=1>From:</FONT> 
    <TD><FONT face=sans-serif size=1>"Mike Beckerle" 
      &lt;mbeckerle.dfdl@gmail.com&gt;</FONT> 
  <TR vAlign=top>
    <TD><FONT face=sans-serif color=#5f5f5f size=1>To:</FONT> 
    <TD><FONT face=sans-serif size=1>&lt;dfdl-wg@ogf.org&gt;</FONT> 
  <TR vAlign=top>
    <TD><FONT face=sans-serif color=#5f5f5f size=1>Date:</FONT> 
    <TD><FONT face=sans-serif size=1>13/05/2009 20:09</FONT> 
  <TR vAlign=top>
    <TD><FONT face=sans-serif color=#5f5f5f size=1>Subject:</FONT> 
    <TD><FONT face=sans-serif size=1>[DFDL-WG] Grammar issue - simple and 
      complex asymetry</FONT></TR></TBODY></TABLE><BR>
<HR noShade>
<BR><BR><BR><FONT size=3>&nbsp;</FONT> <BR><FONT size=3>The draft 034 grammar 
productions do not allow for a separate prefix/suffix for a simple type as 
distinguished from the element having that type. </FONT><BR><FONT 
size=3>&nbsp;</FONT> <BR><FONT size=3>Draft 034 <I>does</I> allow for an element 
of complex type to have a separate prefix and suffix for the element itself and 
another one for the sequence or choice inside it. </FONT><BR><FONT 
size=3>&nbsp;</FONT> <BR><FONT size=3>I've come to believe this is a mistake and 
I suggest a fix below.</FONT> <BR><FONT size=3>&nbsp;</FONT> <BR><FONT 
size=3>Right now the grammar is:</FONT> <BR><FONT face="Courier New" 
size=1>&nbsp;</FONT> <BR><FONT face="Courier New" size=1>Element &nbsp;= 
SimpleElement | ComplexElement</FONT> <BR><FONT face="Courier New" 
size=1>&nbsp;</FONT> <BR><FONT face="Courier New" size=1>SimpleElement = Prefix 
SimpleContent Suffix </FONT><BR><FONT face="Courier New" size=1>&nbsp;</FONT> 
<BR><FONT face="Courier New" size=1>SimpleContent = StringText // terminal. No 
more prefixes/suffixes</FONT> <BR><FONT face="Courier New" size=1>&nbsp;</FONT> 
<BR><FONT face="Courier New" size=1>ComplexElement = Prefix ComplexContent 
Suffix</FONT> <BR><FONT face="Courier New" size=1>&nbsp;</FONT> <BR><FONT 
face="Courier New" size=1>ComplexContent = Sequence | Choice </FONT><BR><FONT 
face="Courier New" size=1>&nbsp;</FONT> <BR><FONT face="Courier New" 
size=1>Sequence = Prefix SequenceContent Suffix</FONT> <BR><FONT 
face="Courier New" size=1>Choice = Prefix ChoiceContent Suffix</FONT> <BR><FONT 
face="Courier New" size=1>&nbsp;</FONT> <BR><FONT size=3>So, if I do:</FONT> 
<BR><FONT face="Courier New" size=1>&nbsp;</FONT> <BR><FONT face="Courier New" 
size=1>&lt;complexType dfdl:initiator="[" dfdl:terminator="]"&gt;</FONT> 
<BR><FONT face="Courier New" size=1>...</FONT> <BR><FONT face="Courier New" 
size=1>&lt;element name="y"&gt;</FONT> <BR><FONT face="Courier New" 
size=1>&nbsp; &lt;complexType&gt;</FONT> <BR><FONT face="Courier New" 
size=1>&nbsp; &lt;sequence dfdl:separator="," &gt;</FONT> <BR><FONT 
face="Courier New" size=1>&nbsp; &nbsp; &nbsp;&lt;element name="x" 
type="int"/&gt;</FONT> <BR><FONT face="Courier New" size=1>&nbsp; &nbsp; 
&nbsp;&lt;element name="z" type="int"/&gt;</FONT> <BR><FONT face="Courier New" 
size=1>&nbsp; &lt;/sequence&gt;</FONT> <BR><FONT face="Courier New" 
size=1>&lt;/complexType&gt;</FONT> <BR><FONT face="Courier New" 
size=1>&lt;/element&gt;</FONT> <BR><FONT face="Courier New" size=1>...</FONT> 
<BR><FONT face="Courier New" size=1>&lt;/complexType&gt;</FONT> <BR><FONT 
face="Courier New" size=1>&nbsp;</FONT> <BR><FONT size=3>I have two prefix 
opportunities. I can flatten the productions above to:</FONT> <BR><FONT 
face="Courier New" size=1>&nbsp;</FONT> <BR><FONT face="Courier New" 
size=1>ComplexElement = Prefix Prefix SequenceContent Suffix Suffix</FONT> 
<BR><FONT face="Courier New" size=1>&nbsp;</FONT> <BR><FONT size=3>An instance 
of this type would look like [[[5],[6]]]. That is, for complex types, there are 
separate prefix and suffix regions for the element, and for the model-group 
which makes up its content.</FONT> <BR><FONT size=3>&nbsp;</FONT> <BR><FONT 
size=3>The first [ initiates element y.</FONT> <BR><FONT size=3>The second [ 
initiates the sequence</FONT> <BR><FONT size=3>The third [ initiates element 
x.</FONT> <BR><FONT size=3>&nbsp;</FONT> <BR><FONT size=3>This same behavior is 
not true for simple types:</FONT> <BR><FONT face="Courier New" 
size=1>&nbsp;</FONT> <BR><FONT face="Courier New" size=1>&lt;complexType 
dfdl:initiator="[" dfdl:terminator="]"&gt;</FONT> <BR><FONT face="Courier New" 
size=1>...</FONT> <BR><FONT face="Courier New" size=1>&nbsp;</FONT> <BR><FONT 
face="Courier New" size=1>&lt;element name="y" &gt;</FONT> <BR><FONT 
face="Courier New" size=1>&nbsp; &lt;simpleType&gt;</FONT> <BR><FONT 
face="Courier New" size=1>&nbsp; &nbsp; &lt;restriction base="int"/&gt;</FONT> 
<BR><FONT face="Courier New" size=1>&nbsp; &lt;/simpleType&gt;</FONT> <BR><FONT 
face="Courier New" size=1>&lt;/element&gt;</FONT> <BR><FONT face="Courier New" 
size=1>...</FONT> <BR><FONT face="Courier New" 
size=1>&lt;/complexType&gt;</FONT> <BR><FONT face="Courier New" 
size=1>&nbsp;</FONT> <BR><FONT size=3>This can only mean [5]. The grammar, as 
formulated in draft 034, does not allow for more than one prefix or 
suffix.</FONT> <BR><FONT size=3>The [ is the initiator of element y. 
</FONT><BR><FONT face="Courier New" size=1>&nbsp;</FONT> <BR><FONT 
size=3>&nbsp;</FONT> <BR><FONT size=3>I believe we should fix this as follows. 
New grammar:</FONT> <BR><FONT face="Courier New" size=1>&nbsp;</FONT> <BR><FONT 
face="Courier New" size=1>Element &nbsp;= SimpleElement | ComplexElement</FONT> 
<BR><FONT face="Courier New" size=1>&nbsp;</FONT> <BR><FONT face="Courier New" 
size=1>SimpleElement = Prefix SimpleContent Suffix</FONT> <BR><FONT 
face="Courier New" size=1>&nbsp;</FONT> <BR><FONT face="Courier New" 
size=1>SimpleContent = StringText </FONT><BR><FONT face="Courier New" 
size=1>&nbsp;</FONT> <BR><FONT face="Courier New" size=1>ComplexElement = 
ComplexContent // Note: no more surrounding prefix suffix.</FONT> <BR><FONT 
face="Courier New" size=1>&nbsp;</FONT> <BR><FONT face="Courier New" 
size=1>ComplexContent = Sequence | Choice </FONT><BR><FONT face="Courier New" 
size=1>&nbsp;</FONT> <BR><FONT face="Courier New" size=1>Sequence = Prefix 
SequenceContent Suffix</FONT> <BR><FONT face="Courier New" size=1>Choice = 
Prefix ChoiceContent Suffix</FONT> <BR><FONT face="Courier New" 
size=1>&nbsp;</FONT> <BR><FONT size=3>The above grammar arranges for an element 
of complex type and its model group to both taken together specify a single 
prefix and suffix.</FONT> <BR><FONT size=3>&nbsp;</FONT> <BR><FONT 
size=3>Revisiting our example (just repeating it here):</FONT> <BR><FONT 
size=3>&nbsp;</FONT> <BR><FONT face="Courier New" size=1>&lt;complexType 
dfdl:initiator="[" dfdl:terminator="]"&gt;</FONT> <BR><FONT face="Courier New" 
size=1>...</FONT> <BR><FONT face="Courier New" size=1>&lt;element 
name="y"&gt;</FONT> <BR><FONT face="Courier New" size=1>&nbsp; 
&lt;complexType&gt;</FONT> <BR><FONT face="Courier New" size=1>&nbsp; 
&lt;sequence dfdl:separator="," &gt;</FONT> <BR><FONT face="Courier New" 
size=1>&nbsp; &nbsp; &nbsp;&lt;element name="x" type="int"/&gt;</FONT> <BR><FONT 
face="Courier New" size=1>&nbsp; &nbsp; &nbsp;&lt;element name="z" 
type="int"/&gt;</FONT> <BR><FONT face="Courier New" size=1>&nbsp; 
&lt;/sequence&gt;</FONT> <BR><FONT face="Courier New" 
size=1>&lt;/complexType&gt;</FONT> <BR><FONT face="Courier New" 
size=1>&lt;/element&gt;</FONT> <BR><FONT face="Courier New" size=1>...</FONT> 
<BR><FONT face="Courier New" size=1>&lt;/complexType&gt;</FONT> <BR><FONT 
face="Courier New" size=1>&nbsp;</FONT> <BR><FONT size=3>An instance now would 
look like [[5],[6]]</FONT> <BR><FONT size=3>&nbsp;</FONT> <BR><FONT size=3>The 
first [ is the initiator of element y, which is the same as the initiator of the 
sequence that is its type.</FONT> <BR><FONT size=3>The second [ is the initiator 
of element x. (which is the same as the initiator of the int that is its 
type)</FONT> <BR><FONT size=3>&nbsp;</FONT> <BR><FONT size=3>I believe this is 
more sensible, as it makes the behavior of simple and complex types more 
similar.</FONT> <BR><FONT size=2>&nbsp;</FONT> <BR><FONT size=3>It begs the 
question of how one combines conflicting properties on an element with the 
properties on the type, and even the model group inside the type in the complex 
case. Because all these properties are describing the same syntax fields in the 
grammar.</FONT> <BR><FONT size=2>&nbsp;</FONT> <BR><FONT size=3>That's a 
separate topic in a subsequent email.</FONT> <BR><FONT 
size=2>&nbsp;</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> <BR><BR><FONT 
face=sans-serif size=2><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>