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

Mandatory attributes on root element

From: Torbjørn Pehrsen <torbjorn.pehrsen@europay.no>
Date: Mon, 21 Jan 2002 06:11:50 -0500 (EST)
Message-ID: <c=NO%a=_%p=Europay_Norge%l=S1-020121110825Z-1373@s1.europay.no>
To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
Hi

I have the following xml file:

<exf xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="M0101.xsd">
	<file>
		<delivering_data_center>700</delivering_data_center>
		<receiving_data_center>1</receiving_data_center>
		<production_date>2001-12-31</production_date>
.
.
</exf>

This is my schema:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
	<xsd:element name="exf">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element ref="file" maxOccurs="unbounded"></xsd:element>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
.
.
</xsd:schema>

I want "xmlns:xsi" and "xsi:noNamespaceSchemaLocation" to be required
abbributes. 

I have tried to put in the following lines:

<xsd:attribute name="xmlns:xsi"  use="required"/>
<xsd:attribute name="xsi:noNamespaceSchemaLocation"  use="required"/>

In most cases I get an invalid schema. If I put them before
</xsd:complexType> I get av valid schema, but my file is no longer valid
with the schema. Anyone?
Received on Monday, 21 January 2002 20:59:18 GMT

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