Trang problems with interleave

Manuel González Castro <[email protected]>
Newsgroups gmane.text.xml.relaxng.general
Organization UDC
Message-ID <[email protected]>
Hello,

I haven't found any Trang mailing list so decided to I post my problem here.

I'm using Trang (version 20030619) to translate my Relax NG schemas to XML
Schemas. I've found that <interleave> element translation works fine if the
patterns inside are elements, but fails if the patterns use definitions.  

This is an example:

--------------------- input file: test.rnc ------------------------

start = element dummy { empty }

# Trang works OK
interleave_without_definitions =
  element test {
    element e1 { empty }
    & element e2 { empty }?
  }

# Trang fails
def1 = element e1 { empty }
def2 = element e2 { empty }
interleave_with_definitions =
 element test { def1  & def2 ? }

--------------------- output file: test.xsd ------------------------

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  elementFormDefault="qualified"> <xs:element name="dummy">
    <xs:complexType/>
  </xs:element>
  <!-- Trang works OK -->
  <xs:group name="interleave_without_definitions">
    <xs:sequence>
      <xs:element name="test">
        <xs:complexType>
          <xs:all>
            <xs:element ref="e1"/>
            <xs:element minOccurs="0" ref="e2"/>
          </xs:all>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:group>
  <xs:element name="e1">
    <xs:complexType/>
  </xs:element>
  <xs:element name="e2">
    <xs:complexType/>
  </xs:element>
  <!-- Trang fails -->
  <xs:group name="interleave_with_definitions">
    <xs:sequence>
      <xs:element name="test">
        <xs:complexType>
          <xs:choice minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="e1"/>
            <xs:element ref="e2"/>
          </xs:choice>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:group>
</xs:schema>

As you can see, "interleave_without_definitions" uses xs:all (fine) but
"interleave_with_definitions" uses "xs:choice" (wrong). 

I need definitions in my schema.
Is there any workarround to this problem ?

Thanks in advance,
Manuel

_______________________________________________
relaxng-user mailing list
[email protected]
http://relaxng.org/mailman/listinfo/relaxng-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.