
Tools and Usage
- edt-include.xsd. The substantive specification, an include file.
May be included (either via xs:include or inline) into schemas that intend to use this definition. It defines a simple type:edtfSimpleType; an element to be defined in an including schema that is to encode date
or date/time data may be assigned this type. This is where all of the XML definitions are, including the regular expressions, all combined into "edtfSimpleType".
A schema may "include" this schema and then reference it for example as follows:
<xs:element name="dateOfBirth" type="edtfSimpleType"/>
- edt.xsd. A simple schema which "inlcudes" the above mentioned incude.xsd. It defines the type "edt" and it allows you to reference it via xsi:type.
For example
<dateOfBirth xsi:type=edtf:edt>
To do this:
- Add
<xs:import
namespace="http://www.loc.gov/standards/datetime/NS/" schemaLocation="http://www.loc.gov/standards/datetime/extendedDateTime.xsd"/>
to your schema (where element <dateOfBirth> is defined).
- Add
xmlns:edtf="http://www.loc.gov/standards/datetime/NS/"
to the root element of your xml file (where element <dateOfBirth> occurs)
- edtTestSchema.xsd.
A schema that allows you to test strings to see if they validate against this specification.
- edtTestFile.xml. An XML file with several example strings that all validate against the test schema, mentioned above. You can add your own example string to see if it validates. Put it in a <dateTime> element with attribute: xsi:type="edtf:edt", like this:
<dateTime xsi:type="edtf:edt">your test string here </dateTime>
Dublin Core Support
- edtDC.xsd This schema is a modification of the edt.xsd schema to support Dublin Core. Allows you to include a DC element in your xml instance, and declare its encoding to be edt:
<dc.date xsi:type="edtf:edt">
To do this:
- Add
xmlns:dc="http://purl.org/dc/elements/1.1/"
to the schema element of your schema (where element <dc.date> is defined) and to the xml instance (where element <dc.date> is defined/occurs).
- Associate the namespace in your schema.
<xs:import namespace="http://www.loc.gov/standards/datetime/NS/" schemaLocation="edtDC.xsd"/>
- Import the DC schema into your schema.
<xs:import namespace="http://purl.org/dc/elements/1.1/" schemaLocation="http://dublincore.org/schemas/xmls/qdc/dc.xsd"/>
|