Re: [Moderator Action] Attribute problem

Torbjørn Pehrsen <torbjorn.pehrsen@europay.no> writes:

> Hi
> 
> I want to define a type called "currency_amount". Which I refer to the
> following way:
> 
> <xsd:element name="currency_amount"
> type="currency_amount_type"></xsd:element>
> 
> I have tried the following: 
> 
> <xsd:complexType name="currency_amount_type">
> <xsd:simpleContent>
> <xsd:restriction base="xsd:decimal">
> <xsd:attribute name="currency" type="xsd:string"
> use="required"></xsd:attribute>
> </xsd:restriction>
> </xsd:simpleContent>
> </xsd:complexType>

You appear to be _adding_ an attribute to a built-in simple type.  So
you want <xsd:extension>, not <xsd:restriction>.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/

Received on Monday, 12 November 2001 08:36:32 UTC