W3C home > Mailing lists > Public > xmlschema-dev@w3.org > December 2000

complexType names

From: Daniel Acton <dacton@itouch.co.za>
Date: Fri, 1 Dec 2000 12:13:19 +0200 (SAST)
To: xmlschema-dev@w3.org
Message-ID: <Pine.BSF.4.21.0012011200320.49065-100000@alcapone.intouch.co.za>

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:19 GMT