Re: [Moderator Action] Extending attributes

Chetan Chudasama <cchetan@nms.fnc.fujitsu.com> writes:

> Hi,
> 
> I am learning schemas and wanted to know how to extend
> attributes.
> By this I mean that if I define an attribute, a global
> attribute say "range" defined in one namespace
> 
> <xsd:schema xmlns = "http://my.com/schemas/MySchema"
>     targetNamespace = "http://my.com/schemas/MySchema"
>     xmlns:xsd = "http://www.w3.org/2000/10/XMLSchema"
>     version = ""
>     elementFormDefault = "unqualified"
>     attributeFormDefault = "unqualified">
>     <xsd:attribute name = "range" use="default" value="5">
>         <xsd:simpleType>
>             <xsd:restriction base = "xsd:integer">
>                 <xsd:maxInclusive value = "5"/>
>                 <xsd:minInclusive value = "2"/>
>             </xsd:restriction>
>         </xsd:simpleType>
>     </xsd:attribute>
> </xsd:schema>
> 
> 
> Now I define another schema in another namespace and I want
> to extend the attribute from this schema
> to increase the range keeping the default same. I know this
> can be done just by defining another attribute
> with a similar definition. But I would still like to know if
> that is possible and how?

Nope -- all simple type derivation is by restriction, and even in the
case of complex types, you can't add back something once you've taken
it away.

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 Friday, 9 March 2001 04:10:24 UTC