[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

redefining or restricting children of a predefined element

From: Mario Madunic <hajduk@imag.net>
Date: Mon, 20 Aug 2007 08:50:43 -0700
Message-ID: <1187625043.46c9b853306fe@members.uniserve.com>
To: xmlschema-dev@w3.org
redefining or restricting children of a predefined element

Any help with the following will be greatly apreciated.

I would like to change the emphasis child of web to not contain an instance of
web itself. This is the sort of recursion I want to avoid. I've looked at
redefine and restriction but seem to be missing something. I do not want to
define a new emphasis element within web as it is already defined and want to do
the restriction within web itself (<xs:element ref="emphasis" /> and used
throughout the schema).


Here is a copy of the elements in question without the include statements. The
child model is much bigger, children have been removed for brevity :) 

<xs:element name="web" id="web">
  <xs:complexType mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element ref="emphasis" />
      <xs:element ref="imageInline" />
      <xs:element ref="strong" />
    </xs:choice>
    <xs:attributeGroup ref="attributeStandardInlineGroup" />
    <xs:attribute name="uri" type="xs:anyURI" use="optional" />
    <xs:attribute ref="target" use="optional" />
  </xs:complexType>
</xs:element>

<xs:element name="emphasis" id="emphasis">
  <xs:complexType mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element ref="email" />
      <xs:element ref="strong" />
      <xs:element ref="web" />
    </xs:choice>
    <xs:attributeGroup ref="attributeInlineGroup" />
  </xs:complexType>
</xs:element>

Marijan (Mario) Madunic
Received on Monday, 20 August 2007 21:17:54 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.