W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2001

Forcing a certain document element

From: Ian Stokes-Rees <ian@decisionsoft.com>
Date: Fri, 12 Jan 2001 17:09:54 +0000
Message-ID: <3A5F3A62.DF32776B@decisionsoft.com>
To: "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
I would like to force a single document element to be valid in my
schema, however I have designed my sechma so it looks like (for
illustration purposes only):

  <element name="documentElement">
      <element ref="someRefElement" minOccurs="0"

  <element name="someRefElement">
      <attribute name="foo" use="required"/>
      <attribute name="bar" use="required"/>

And I would like this XML document to validate:
  <someRefElement foo="1" bar="2"/>

But not have this validate:

<someRefElement foo="1" bar="2" />

(where "someRefElement" is the document element).

How can I use XSDL to enforce this?

ian.stokes-rees@decisionsoft.com          tel: +1865 203 192
DecisionSoft Ltd.                         fax: +1865 203 194
www.decisionsoft.com                      Oxford, UK, OX2 OEA
Received on Friday, 12 January 2001 12:09:47 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:14:49 UTC