complexType names

Hi

I am trying to define a schema for an xml document that may start with a
different root element in different instances of the xml document.

-- Instance 1, in a file called cat.xml --

<Cat>
  <height>23cm</height>
  <weight>7kg</weight>
</Cat>

-- End of Instance 1 --

-- Instance 2, in a file called dog.xml --

<Dog>
  <height>35cm</height>
  <weight>18kg</weight>
</Dog>

-- End of Instance 2 --


The two instances will have the same elements, but with a different root
element. Do I have to write two seperate schemas for this? The examples
I've been looking at have this kind of definition of the root element:

<xsd:schema xmlns:xsd="http://www.w3.org/1999/XMLSchema">
  <xsd:element type="someComplexType" name="xmlRootElement"/>
  <xsd:complexType name="someComplexType">
    <!-- complexType definition here -->
  </xsd:complexType>
  <!-- Rest of schema definition here -->
</xsd:schema>


Thanks in advance
Daniel

Received on Friday, 1 December 2000 05:17:02 UTC