Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
<xsd:schema
        targetNamespace="info:fedora/fedora-system:def/dsCompositeModel#"
        xmlns="info:fedora/fedora-system:def/dsCompositeModel#"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        elementFormDefault="qualified"
        attributeFormDefault="unqualified">
    <xsd:element name="dsCompositeModel">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element minOccurs="0" maxOccurs="unbounded" ref="dsTypeModel"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="dsTypeModel">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element minOccurs="0" maxOccurs="unbounded" ref="form"/>
                <xsd:element minOccurs="0" maxOccurs="unbounded" ref="extension"/>
            </xsd:sequence>
            <xsd:attribute name="ID" use="required"/>
            <xsd:attribute name="optional" use="optional" type="xsd:boolean"/>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="extension">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:any namespace="##any" processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
            </xsd:sequence>
            <xsd:attribute name="name" use="required"/>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="form">
        <xsd:complexType>
            <xsd:attribute name="FORMAT_URI" use="optional" type="xsd:anyURI"/>
            <xsd:attribute name="MIME" use="optional"/>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="reference">
        <xsd:complexType>
            <xsd:attribute name="type"/>
            <xsd:attribute name="datastreamvalue"/>
        </xsd:complexType>
    </xsd:element>
</xsd:schema>

...

Code Block
<dsCompositeModel
        xmlns="info:fedora/fedora-system:def/dsCompositeModel#"
        xmlns:schema="http://ecm.sourceforge.net/types/dscompositeschema/0/1/#">

    <!-- The DC datastream is declared. It's mime type must be text/xml. It must adhere to the xml schema residing in the DC_SCHEMA datastream in this content model. -->
    <dsTypeModel ID="DC">
        <form MIME="text/xml"/>
        <extension name="SCHEMA">
            <reference type="xsddatastream" datastreamvalue="DC_SCHEMA"/>
        </extensions>
    </dsTypeModel>

    <!-- The ORIGIN datastream is declared. It's mime type must be text/xml. It must adhere to the xml schema residing in the ORIGIN_SCHEMA datastream in this content model-->
    <dsTypeModel ID="ORIGIN">
        <form MIME="text/xml"/>
        <extension name="SCHEMA">
            <reference type="xsddatastream" datastreamvalue="ORIGIN_SCHEMA"/>
        </extensions>
    </dsTypeModel>

</dsCompositeModel>

...

1. xml embedded in the object (inline content)
2. bytes embedded in the object (managed content)
3. external file referenced by URL. (External and Redirect content)

The schema extension will only concern itself with the first option, namely the xml embedded in the datastream. For XML, there already exist a commonly accepted system for specifying the content, i.e. XML Schema. MORE ON THIS LATERdoes not care what kind of datastream is is applied to. But it only makes sense to apply it to a datastream with xml content, even if this xml content is externally referenced