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

Problem with pattern and empty element

From: kfricovsky <kfricovsky@fusebox.com>
Date: Thu, 15 Nov 2001 12:33:30 -0500
To: <xmlschema-dev@w3.org>
Message-ID: <007401c16dfb$a4a17c70$4a01a8c0@fuseboxk1>
Hello,

I have this element in my XML SCHEMA:

<xsd:element name="XXX">
	<xsd:simpleType>
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="([0-9]+|[A-Z]+)+" />
		</xsd:restriction>
	</xsd:simpleType>
</xsd:element>

I am using XML SPY to validate my XML using the SCHEMA I created. The
problem I am having is leaving this element as an empty element,  like
<XXX/>. XML SPY says that the XML doc isn't well formed unless I insert
a value conforming to my pattern.

Is there a way to define a NULL value or some kind of default value that
will allow this element to be left empty?

Thanks,

Kevin
Received on Thursday, 15 November 2001 12:29:46 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:13:35 GMT