[xsd-users] Need schema suggestions

Manav Rathi manav.rathi at incainformatics.com
Thu May 29 01:26:38 EDT 2008


I wish to create a schema that will allow me to use both the following XML:

1)
<foo>
 <bar>
  <x />
  <y />
 </bar>
</foo>

2)
<foo>
 <bar>
  <a />
  <b />
 </bar>
</foo>

Any XSD schema design suggestions? 

Right now, what I thinking of is

<complexType name="bar_base">
</complexType>

<complexType name="bar_with_x_and_y">
 <complexContent>
  <extension base="bar_base">
  ...
  </extension>
 </complexContent>
</complexType>

<complexType name="bar_with_a_and_b">
 <complexContent>
  <extension base="bar_base">
  ...
  </extension>
 </complexContent>
</complexType>

But this seems to be overkill, especially considering the fact that bar is
an anonymous type that can only occur with the context of foo.





More information about the xsd-users mailing list