Re: [relax-ng] converting relax ng schema to w3c schema?

From
James Clark <>
Date
2002-06-20T10:59:00+00:00
ID
199921732.1024595937@[192.168.0.12]
Thread
Re: [relax-ng] converting relax ng schema to w3c schema?
> Furthermore, I do think that the semantic of RNG
>
> <define name="barPattern">
>  <element name="bar">
>   .../...
>  </element>
> </define>

Hmm.  Given the above pattern and a reference <ref name="barPattern"/>, 
there are (at least) three possibilities:

1. <xs:group ref="barPattern"/>

<xs:group name="barPattern">
  <xs:sequence>
    <xs:element name="bar">
      ...
    </xs:element>
  </xs:sequence>
</xs:group>


2. <xs:element ref="bar"/>

<xs:element name="bar">
  ...
</xs:element>


3. <xs:group ref="barPattern"/>

<xs:group name="barPattern">
  <xs:sequence>
    <xs:element ref="bar"/>
  </xs:sequence>
</xs:group>

<xs:element name="bar">
  ...
</xs:element>

Currently I generate either 1 or 2 depending on whether I decided to make 
that particular element pattern global. My feeling was that 2 would result 
in a more natural XML Schema (which I admit is very subjective). Another 
reason is that 1 and 3 (I think) don't work in an xs:all whereas 2 does.

Another complication is what to do with something like

  inline = element code|em|b|i { ... }

James