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

RE: Problems with definingt simple restriction

From: Kriegesmann, Peter <Peter.Kriegesmann@softwareag.com>
Date: Mon, 16 Dec 2002 15:05:34 +0100
Message-ID: <DFF2AC9E3583D511A21F0008C7E621060237252F@daemsg02.software-ag.de>
To: "'sre@bizpartner.no'" <sre@bizpartner.no>, xmlschema-dev@w3.org

You try to restrict the built-in datatype "xs:double", which does not have
an attribute "currency".

Your base type must contain at least an attribute definition called
"currency".
So it has to be a complexType definition with simpleContent child.

The following should work:

	<xs:complexType name="basePrice">
		<xs:simpleContent>
			<xs:extension base="xs:double">
				<xs:attribute name="currency"
type="xs:string" use="required"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>

	<xs:complexType name="Price">
		<xs:simpleContent>
			<xs:restriction base="basePrice">
				<xs:fractionDigits value="2"/>

			</xs:restriction >
		</xs:simpleContent>
      </xs:complexType>

Best regards,
Peter


Peter Kriegesmann
Phone	 06151-921484
Electronic Business Technologies (QE)				Fax
06151-921612
			
Software AG
http://www.softwareag.com
Uhlandstrasse 12				  
D-64297 Darmstadt
mailto:Peter.Kriegesmann@softwareag.com	

>  -----Original Message-----
> From: 	Steinar Rune Eriksen [mailto:sre@bizpartner.no] 
> Sent:	Montag, 16. Dezember 2002 14:51
> To:	xmlschema-dev@w3.org
> Cc:	Steinar Rune Eriksen
> Subject:	Problems with definingt simple restriction
> 
> hi
> 
> This construction used to work 6 months ago... (using XML Spy 3.5 under
> xmlns="http://www.w3.org/2001/XMLSchema" )
> 
> 	<complexType name="Price">
> 		<simpleContent>
> 			<restriction base="double">
> 				<fractionDigits value="2"/>
> 				<attribute name="currency" type="string"
> use="required"/>
> 			</restriction >
> 		</simpleContent>
>       </complexType>
> 
> Using XML Spy 5, I get a validation error on restriction _base_, seeming
> that this is not valid anymore. I cannot find any examples either of
> restrction being used as child under simpleContent, though it seems like
> it should be valid according to spec. Am I wrong?
> 
> Med vennlig hilsen
> 
> Steinar Rune Eriksen
> BIZ Partner
> Tel:    (+47) 67 57 15 52
> Mobile: (+47) 90 52 81 48
> http://www.bizpartner.no
> 
Received on Monday, 16 December 2002 09:05:39 GMT

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