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

Problem with restricting a W3C Schema Type

  • To: <xml-dev@l...>
  • Subject: Problem with restricting a W3C Schema Type
  • From: "Mark Seaborne" <MSeaborne@o...>
  • Date: Fri, 15 Nov 2002 15:53:16 -0000
  • Thread-index: AcKMvVmC3K175CIIRYekCH+yTJuMYAAAArNg
  • Thread-topic: dtds, schemas, xhtml, and multimedia technologies

xsd id type
Hi

I have got a complex type in a schema that looks like this:

<xsd:complexType name="Term">
	<xsd:sequence>
		<xsd:element name="years" minOccurs="0">
			<xsd:complexType>
				<xsd:simpleContent>
					<xsd:extension base="origo:SmallNumber">
						<xsd:attribute name="id" type="xsd:ID"/>
					</xsd:extension>
				</xsd:simpleContent>
			</xsd:complexType>
		</xsd:element>
		<xsd:element name="months" minOccurs="0">
			<xsd:complexType>
				<xsd:simpleContent>
					<xsd:extension base="origo:SmallNumber">
						<xsd:attribute name="id" type="xsd:ID"/>
					</xsd:extension>
				</xsd:simpleContent>
			</xsd:complexType>
		</xsd:element>
	<xsd:attribute name="id" type="xsd:ID"/>
</xsd:complexType>

I want to construct an element that restricts type "Term" to have only a "years" child element.

I am having problems getting this to work. 

If I remove the attribute "id" from the definition of "years", a restriction of "Term" works fine, but otherwise I get an error.

Any hints, or pointers to helpful documentation would be gratefully received.

All the best

Mark Seaborne

The information in this email is sent in confidence for the addressee only and may be legally privileged.  Unauthorised recipients must preserve this confidentiality and should please advise the sender immediately of the error in transmission.  If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on its content is prohibited and may be unlawful.

Origo Services Ltd accepts no responsibility for any loss or damage resulting directly or indirectly from the use of this email or the contents.  

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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-2013 All Rights Reserved.