W3C home > Mailing lists > Public > xmlschema-dev@w3.org > July 2003

How to restrict the values of attributes in my own element declarations when they are defined in another namespace

From: Geoff <geoff@galexy.net>
Date: Wed, 30 Jul 2003 19:59:40 +1000
To: <xmlschema-dev@w3.org>
Message-Id: <E19hnkM-0000zE-00@galexy.cimtec.net.au>
I am trying to find a way to restrict the value of an xlink:type attribute
depending on the element in which it is used.


The xlink:type attribute is defined in a schema like: 


<schema targetNamespace="http://www.w3.org/1999/xlink" 





      <simpleType name="typeEnum">



            Enumeration of values for the type attribute



            <restriction base="string">

                  <enumeration value="simple"/>

                  <enumeration value="extended"/>

                  <enumeration value="locator"/>

                  <enumeration value="arc"/>

                  <enumeration value="resource"/>

                  <enumeration value="title"/>




      <attribute name="type" type="xlink:typeEnum"/>



I am then trying to define extended link, locator, resource etc elements in
my own namespace and determine which of these enumerated values are legal
for the specific elements.


Thus, the schema in my own namespace looks like:


<schema targetNamespace="http://www.xbrl.org/2001/XLink" 







      <import namespace="http://www.w3.org/1999/xlink" 



      <complexType name="locatorType">



                  Generic locator type.




                  <restriction base="anyType">


                              <element ref="xl:title" minOccurs="0"
maxOccurs="unbounded" />


                        <attribute ref="xlink:type" use="required">



                                    This attribute must have a value of




                        <attribute ref="xlink:href" use="required" />

                        <attribute ref="xlink:label" use="required" />

                        <attribute ref="xlink:role" use="optional" />

                        <attribute ref="xlink:title" use="optional" />




      <element name="myLocator" type="xl:locatorType" />



Any suggestions on how to impose this kind of restriction would be
gratefully received,




Geoff Shuetrim

Received on Wednesday, 30 July 2003 06:00:25 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:02 UTC