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

How to enumerate possible values for an attribute from another file?

From: vze3y7w8 <boris.kortiak@verizon.net>
Date: Sat, 30 Nov 2002 18:11:15 -0500
To: <xmlschema-dev@w3.org>
Message-ID: <000b01c298c5$c8b59d80$33fc5044@VAIO590G01>
Actually, there is more to this question than stated in the subject; if
necessary, I will post them separately.


I have defined an XSD with a tag (I know that isn't the right word, but
it has slipped my mind at the moment) that has the attribute "Language".


                <xs:element name="uTitle" minOccurs="0"



                           <xs:extension base="xs:string">

                                  <xs:attribute name="Language"
type="xs:language" use="required"/>







Separately, I have created an XML document that looks something like






















What I would like to do, is have the list of possible values for the
"Language" attribute restricted to the values in the "Abbreviation"
elements of the "Languages" document.


The other half of this question is more of XSD design problem.  When I
started this I just added this attribute to a variety of elements.  This
has now become unwieldy to use.  Is there a way to define an attribute
globally for use in a variety of elements, such that it keeps the
enumerated list of values intact?




Received on Saturday, 30 November 2002 18:11:41 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:59 UTC