XML Schema Question: attributing an element with a datatype?

Roger L. Costello costello at mitre.org
Tue Feb 1 12:03:30 GMT 2000


Roger L. Costello wrote:
> >             <element name="cost">
> >                 <type source="money">
> >                     <attribute name="currency" minOccurs="1">
> >                         <datatype name="currencies" source="string">
> >                             <enumeration value="USD"/>
> >                             <enumeration value="CND"/>
> >                         </datatype>
> >                     </attribute>
> >                 </type>
> >             </element>
> >
> > The element "type" has an optional attribute "source" which I set to > > the user-defined datatype "money".

Stefan Haustein responded:
> I do not believe that will work. type source="..." is probably
> not intended to look into the (different) datatype namespace.

Here is an example from the XML Schema spec that I based my solution
upon:

    <element name="picture">
        <type source="binary" derivedBy="extension">
            <attribute name="pictype" type="NOTATION"/>
        </type>
    </element>

This example shows the source attribute referencing the built-in
datatype "binary".  I inferred that the source attribute could also
reference a built-in datatype (e.g., the money datatype).  Do I infer
incorrectly?  /Roger


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ or CD-ROM/ISBN 981-02-3594-1
Please note: New list subscriptions and unsubscriptions
are  now ***CLOSED*** in preparation for list transfer to OASIS.





More information about the Xml-dev mailing list