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

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"
maxOccurs="unbounded">

              <xs:complexType>

                    <xs:simpleContent>

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

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

                           </xs:extension>

                    </xs:simpleContent>

              </xs:complexType>

       </xs:element>

.

 

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

 

<Languages>

            <Language>

                        <Abbreviation>aa</Abbreviation>

                        <Name>Afar</Name>

            </Language>

            <Language>

                        <Abbreviation>ab</Abbreviation>

                        <Name>Abkhazian</Name>

            </Language>

.

            <Language>

                        <Abbreviation>zh</Abbreviation>

                        <Name>Chinese</Name>

            </Language>

            <Language>

                        <Abbreviation>zu</Abbreviation>

                        <Name>Zulu</Name>

            </Language>

</Languages>

 

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?

 

TIA

--
boris@kortiak.com
http://www.boriskortiak.com/

 

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