OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Problem with restricting a W3C Schema Type

[ Lists Home | Date Index | Thread Index ]
  • To: <xml-dev@lists.xml.org>
  • Subject: Problem with restricting a W3C Schema Type
  • From: "Mark Seaborne" <MSeaborne@origoservices.com>
  • Date: Fri, 15 Nov 2002 15:53:16 -0000
  • Thread-index: AcKMvVmC3K175CIIRYekCH+yTJuMYAAAArNg
  • Thread-topic: [xml-dev] dtds, schemas, xhtml, and multimedia technologies

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.  




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS