<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1264" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#d4d0c8>
<DIV><SPAN class=q0>Hello,<BR><BR>I haven't found any Trang mailing list so 
decided to I post my problem here.<BR><BR>I'm using Trang (version 20030619) to 
translate my Relax NG schemas to XML<BR>Schemas. I've found that 
&lt;interleave&gt; element translation works fine if the<BR>patterns inside are 
elements, but fails if the patterns use definitions. &nbsp;<BR><BR>This is an 
example:<BR><BR>--------------------- input file: test.rnc 
------------------------<BR><BR>start = element dummy { empty }<BR><BR># Trang 
works OK<BR>interleave_without_definitions =<BR>&nbsp; element test {<BR>&nbsp; 
&nbsp; element e1 { empty }<BR>&nbsp; &nbsp; &amp; element e2 { empty 
}?<BR>&nbsp; }<BR><BR># Trang fails<BR>def1 = element e1 { empty }<BR>def2 = 
element e2 { empty }<BR>interleave_with_definitions =<BR>&nbsp;element test { 
def1 &nbsp;&amp; def2 ? }<BR><BR>--------------------- output file: test.xsd 
------------------------<BR><BR>&lt;?xml version="1.0" 
encoding="UTF-8"?&gt;<BR>&lt;xs:schema xmlns:xs="<A class=0 
href="http://www.w3.org/2001/XMLSchema"><FONT 
color=#000000>http://www.w3.org/2001/XMLSchema</FONT></A>"<BR>&nbsp; 
elementFormDefault="qualified"&gt; &lt;xs:element name="dummy"&gt;<BR>&nbsp; 
&nbsp; &lt;xs:complexType/&gt;<BR>&nbsp; &lt;/xs:element&gt;<BR>&nbsp; &lt;!-- 
Trang works OK --&gt;<BR>&nbsp; &lt;xs:group 
name="interleave_without_definitions"&gt;<BR>&nbsp; &nbsp; 
&lt;xs:sequence&gt;<BR>&nbsp; &nbsp; &nbsp; &lt;xs:element 
name="test"&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &lt;xs:complexType&gt;<BR>&nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &lt;xs:all&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &lt;xs:element ref="e1"/&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&lt;xs:element minOccurs="0" ref="e2"/&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&lt;/xs:all&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/xs:complexType&gt;<BR>&nbsp; 
&nbsp; &nbsp; &lt;/xs:element&gt;<BR>&nbsp; &nbsp; 
&lt;/xs:sequence&gt;<BR>&nbsp; &lt;/xs:group&gt;<BR>&nbsp; &lt;xs:element 
name="e1"&gt;<BR>&nbsp; &nbsp; &lt;xs:complexType/&gt;<BR>&nbsp; 
&lt;/xs:element&gt;<BR>&nbsp; &lt;xs:element name="e2"&gt;<BR>&nbsp; &nbsp; 
&lt;xs:complexType/&gt;<BR>&nbsp; &lt;/xs:element&gt;<BR>&nbsp; &lt;!-- Trang 
fails --&gt;<BR>&nbsp; &lt;xs:group 
name="interleave_with_definitions"&gt;<BR>&nbsp; &nbsp; 
&lt;xs:sequence&gt;<BR>&nbsp; &nbsp; &nbsp; &lt;xs:element 
name="test"&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &lt;xs:complexType&gt;<BR>&nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &lt;xs:choice minOccurs="0" 
maxOccurs="unbounded"&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&lt;xs:element ref="e1"/&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&lt;xs:element ref="e2"/&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&lt;/xs:choice&gt;<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
&lt;/xs:complexType&gt;<BR>&nbsp; &nbsp; &nbsp; &lt;/xs:element&gt;<BR>&nbsp; 
&nbsp; &lt;/xs:sequence&gt;<BR>&nbsp; 
&lt;/xs:group&gt;<BR>&lt;/xs:schema&gt;<BR><BR>As you can see, 
"interleave_without_definitions" uses xs:all (fine) 
but<BR>"interleave_with_definitions" uses "xs:choice" (wrong). 
<BR><BR>I&nbsp;need definitions in my schema.<BR>Is there any workarround to 
this problem ?<BR><BR>Thanks in 
advance,<BR>Manuel<BR></SPAN></DIV></BODY></HTML>