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

Empty elements?

From: Hollom, Rupert (ITD) <Rupert.Hollom@maff.gsi.gov.uk>
Date: Thu, 9 Nov 2000 15:51:57 -0000
Message-ID: <6EA1753FFBA0D411B92C0008C75B936A09A162@gb013dx.maff.gov.uk>
To: "Xmlschema-Dev (E-mail)" <xmlschema-dev@w3.org>
Sorry if this is a dumb question...

I have written an XML Schema that on the whole is OK, however I have got one
problem with it - there are two elements that are required but could
potentially be empty.  

Here is an extract from my schema for one of the elements:
...
<xsd:element name="otherholdings" type="eforms:OtherHoldingsStructure"/>
...
	<!-- Start of OtherHoldingsStructure type definition -->
	<xsd:complexType name="OtherHoldingsStructure">
		<xsd:element name="holding" minOccurs="0"
maxOccurs="unbounded">
			<xsd:complexType>
				<xsd:sequence>
					<xsd:element name="cph"
type="eforms:CPHnumType"/>
					<xsd:element name="area"
type="eforms:AreaType"/>
				</xsd:sequence>
			</xsd:complexType>
		</xsd:element>
	</xsd:complexType>
	<!-- End of OtherHoldingsStructure type definition -->

and from an example document:
...
<otherholdings/>
...

When I attempt to validate the document using the Oracle schema parser it
gives the following error:
<Line 27, Column 18>: XSD-2021: (Error) Element not completed:
'otherholdings'
<Line 109, Column 13>: XSD-2021: (Error) Element not completed: 'hillfarm'
Parser Exception: Element not completed: 'otherholdings'

'hillfarm' is the other similar element, so my question is how do I do this
with the schema?

Thanks in adavance,
Rupert.
========================
Rupert Hollom
E-Forms Technical Specialist
EMail: rupert.hollom@maff.gsi.gov.uk
Received on Thursday, 9 November 2000 10:53:42 GMT

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