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

xsd:date and xsd:pattern together for custom data type

From: Omprakash Bachu <omprakash.bachu@mphasis.com>
Date: Mon, 21 Oct 2002 16:37:59 -0400 (EDT)
To: <xmlschema-dev@w3.org>
Message-ID: <KJEPLMFMIKDIKKDPGEBGIENOCGAA.omprakash.bachu@mphasis.com>




Hi I got a question, I want the solution something like, mentioned in the
below URL for custom datatype for date.

http://lists.w3.org/Archives/Public/xmlschema-dev/2001Jul/0040.html

I've declared in the below format, but the XMLSpy tool is giving an error
the attribute tag is invalid child.

	<xsd:element name="eosdate">
	   	<xsd:simpleType>
			<xsd:restriction base="xsd:string">
				<xsd:pattern value="[0,1]{1}[0-9]{1}/[0-3]{1}[0-9]{1}/[0-9]{2}"/>
			</xsd:restriction>
		</xsd:simpleType>
		<xsd:attribute name="value" type="xsd:date"/>
	</xsd:element>


or I also tried, declaring as a global element and use in the model

	   	<xsd:simpleType name="eosdate">
			<xsd:restriction base="xsd:string">
				<xsd:pattern value="[0,1]{1}[0-9]{1}/[0-3]{1}[0-9]{1}/[0-9]{2}"/>
			</xsd:restriction>
          		<xsd:attribute name="value" type="xsd:date"/>
		</xsd:simpleType>

can any one of you please help me out.

Note: Basically I want the date like mm/dd/yy format having the valid values
01/01/00 to 12/31/99'

thanks in advance
 Om
646-456-5087
Received on Tuesday, 29 October 2002 07:12:41 GMT

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