Dear Pete,
Sorry I missed that point raised by Roland - but I'm not sure you're
right. Its certainly more complex but you can apply restrictions to
complexTypes. I think you can do the following but I need to test it
with XML Spy:
In the 'simple DC' XML Schema DCMI namepace you define the generic
elementType:
<complexType name="elementType"
<simpleContent>
<extension base="anySimpleType">
<attribute ref="x:lang" use="optional"/>
</extension>
</simpleContent>
</complexType>
<element name="date" type="elementType/>
Then if a user wants their date element to use the 'date' datatype,
they define their own element based on the dc:elementType, in their own
schema:
<element name="myDate">
<xs:complexType>
<xs:simpleContent>
<xs:restriction base="dc:elementType">
<simpleContent>
<extension base="date">
<attribute ref="x:lang" use="optional"/>
</extension>
</simpleContent>
</xs:restriction>
</xs:simpleContent>
</xs:complexType>
</xs:element>
This is pretty complex, so I'm starting to think the pure and simple,
string and vanilla (sounds like a song) approach is the easiest. If
anyone wants anything other than strings, or facets of strings, then
they have to declare their own element, but we could consider providing
a 'semantics' attribute which can be included in the user's definition,
to point to the DC element definition:
<element name="myDate" type="xsd:date" xx:semantics=
"http://www.dublincore.org/documents/1999/07/02/dces/#date"/>
Since the semantic definition of each element is the important stable
part of DC, then this seems a sensible approach (to me at least).
jane
> Is there not a problem that the current "base" element type in the
> simpledc schema isn't a simpleType? i.e. if we allow the use of the
> xml:lang attribute (which was part of the initial proposal for "simple
> DC", and I don't _think_ has been rejected along the way?), I think that
> makes the "base" element type a "complexType" in XML Schema terms, which
> introduces the problem pointed out by Roland here
>
> http://www.jiscmail.ac.uk/cgi-bin/wa.exe?A2=ind0203&L=dc-architecture&F=
> &S=&P=7240
>
> of deriving simpleTypes from that starting point.
>
> Does this mean we need separate "per-DC-element" types, where some
> elements have complexTypes permitting xml:lang and others have only
> simpleTypes based only on "anySimpleType"?
>
> Pete
|