Re: XML Schema Question: attributing an element with a datatype?

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

Received on Tuesday, 1 February 2000 07:03:29 UTC