Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<?xml version="1.0" encoding="UTF-8"?>
<!--***********************************************************************-->
<!-- TITLE       : FOXML 1.1 XSD Schema                                    -->
<!-- DESCRIPTION : This document expresses the basic structure and         -->
<!--               constraints for objects encoded in FOXML 1.1.           -->
<!--               This schema, when combined with the FOXML 1.1           -->
<!--               Schematron Rules, can be used to fully validate         -->
<!--               a FOXML 1.1 XML document.                               -->
<!-- CHANGELOG   : (1.0 to 1.1)                                            -->
<!--               o Added a required VERSION attribute to the root        -->
<!--                 element, which must have a value of "1.1".            -->
<!--               o Removed disseminator-related elements (disseminator   -->
<!--                 elements have been removed from the FOXML format      -->
<!--                 due to the CMA).                                      -->
<!--               o Removed #contentModel property (As of Fedora 3.0,     -->
<!--                 content model is asserted via RELS-EXT predicate,     -->
<!--                 fedora-model:hasContentModel                          -->
<!--               o Removed rdf:type property, since typeness is          -->
<!--                 determined by the content model(s)                    -->
<!--***********************************************************************-->
<xsd:schema targetNamespace="info:fedora/fedora-system:def/foxml#" xmlns="info:fedora/fedora-system:def/foxml#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<!-- the root element for FOXML: digitalObject -->
	<xsd:element name="digitalObject">
		<xsd:annotation>
			<xsd:documentation/>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:complexContent>
				<xsd:extension base="digitalObjectType"/>
			</xsd:complexContent>
		</xsd:complexType>
	</xsd:element>
	<!-- complex type declarations -->
	<xsd:complexType name="digitalObjectType">
		<xsd:sequence>
			<xsd:element name="objectProperties" type="objectPropertiesType"/>
			<xsd:element name="datastream" type="datastreamType" minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>
		<xsd:attribute name="VERSION" use="required">
			<xsd:simpleType>
				<xsd:restriction base="xsd:string">
					<xsd:enumeration value="1.1"/>
                </xsd:restriction>
            </xsd:simpleType>
        </xsd:attribute>
		<xsd:attribute name="PID" type="pidType" use="optional"/>
		<xsd:attribute name="FEDORA_URI" type="xsd:anyURI" use="optional"/>
		<xsd:anyAttribute namespace="##other" processContents="lax"/>
	</xsd:complexType>
	<xsd:complexType name="objectPropertiesType">
		<xsd:sequence>
			<xsd:element name="property" type="propertyType" maxOccurs="unbounded"/>
			<xsd:element name="extproperty" type="extpropertyType" minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="datastreamType">
		<xsd:sequence>
			<xsd:element name="datastreamVersion" type="datastreamVersionType" maxOccurs="unbounded"/>
		</xsd:sequence>
		<xsd:attribute name="ID" type="idType" use="required"/>
		<xsd:attribute name="CONTROL_GROUP" use="required">
			<xsd:simpleType>
				<xsd:restriction base="xsd:string">
					<xsd:enumeration value="E"/>
					<xsd:enumeration value="M"/>
					<xsd:enumeration value="R"/>
					<xsd:enumeration value="X"/>
				</xsd:restriction>
			</xsd:simpleType>
		</xsd:attribute>
		<xsd:attribute name="FEDORA_URI" type="xsd:anyURI" use="optional"/>
		<xsd:attribute name="STATE" type="stateType" use="optional"/>
		<xsd:attribute name="VERSIONABLE" type="xsd:boolean" use="optional" default="true"/>
	</xsd:complexType>
	<xsd:complexType name="datastreamVersionType">
		<xsd:sequence>
			<xsd:element name="contentDigest" type="contentDigestType" minOccurs="0"/>
			<xsd:choice>
				<xsd:element name="xmlContent" type="xmlContentType"/>
				<xsd:element name="contentLocation" type="contentLocationType"/>
				<xsd:element name="binaryContent" type="xsd:base64Binary"/>
			</xsd:choice>
		</xsd:sequence>
		<xsd:attribute name="ID" type="idType" use="required"/>
		<xsd:attribute name="LABEL" type="xsd:string" use="optional"/>
		<xsd:attribute name="CREATED" type="xsd:dateTime" use="optional"/>
		<xsd:attribute name="MIMETYPE" type="xsd:string" use="required"/>
		<xsd:attribute name="ALT_IDS" type="uriListType" use="optional"/>
		<xsd:attribute name="FORMAT_URI" type="xsd:anyURI" use="optional"/>
		<xsd:attribute name="SIZE" type="xsd:long" use="optional" default="0"/>
	</xsd:complexType>
	<xsd:complexType name="contentDigestType">
		<xsd:attribute name="TYPE" use="optional">
			<xsd:simpleType>
				<xsd:restriction base="xsd:string">
					<xsd:enumeration value="MD5"/>
					<xsd:enumeration value="SHA-1"/>
					<xsd:enumeration value="SHA-256"/>
					<xsd:enumeration value="SHA-384"/>
					<xsd:enumeration value="SHA-512"/>
					<xsd:enumeration value="HAVAL"/>
					<xsd:enumeration value="TIGER"/>
					<xsd:enumeration value="WHIRLPOOL"/>
					<xsd:enumeration value="DISABLED"/>
				</xsd:restriction>
			</xsd:simpleType>
		</xsd:attribute>
		<xsd:attribute name="DIGEST" type="xsd:string" use="optional"/>
	</xsd:complexType>
	<xsd:complexType name="xmlContentType">
		<xsd:sequence>
			<xsd:any namespace="##any" processContents="skip" maxOccurs="unbounded"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="contentLocationType">
		<xsd:attribute name="TYPE" use="required">
			<xsd:simpleType>
				<xsd:restriction base="xsd:string">
					<xsd:enumeration value="INTERNAL_ID"/>
					<xsd:enumeration value="URL"/>
				</xsd:restriction>
			</xsd:simpleType>
		</xsd:attribute>
		<xsd:attribute name="REF" use="required">
			<xsd:simpleType>
				<xsd:restriction base="xsd:anyURI">
					<xsd:minLength value="1"/>
				</xsd:restriction>
			</xsd:simpleType>
		</xsd:attribute>
	</xsd:complexType>
	<xsd:complexType name="propertyType">
		<xsd:attribute name="NAME" use="required">
			<xsd:simpleType>
				<xsd:restriction base="xsd:string">
					<xsd:enumeration value="info:fedora/fedora-system:def/model#state"/>
					<xsd:enumeration value="info:fedora/fedora-system:def/model#label"/>
					<xsd:enumeration value="info:fedora/fedora-system:def/model#createdDate"/>
					<xsd:enumeration value="info:fedora/fedora-system:def/view#lastModifiedDate"/>
					<xsd:enumeration value="info:fedora/fedora-system:def/model#ownerId"/>
				</xsd:restriction>
			</xsd:simpleType>
		</xsd:attribute>
		<xsd:attribute name="VALUE" type="xsd:string" use="required"/>
	</xsd:complexType>
	<xsd:complexType name="extpropertyType">
		<xsd:attribute name="NAME" type="xsd:string" use="required"/>
		<xsd:attribute name="VALUE" type="xsd:string" use="required"/>
	</xsd:complexType>
	<xsd:simpleType name="stateType">
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="A"/>
			<xsd:enumeration value="D"/>
			<xsd:enumeration value="I"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- See http://www.fedora.info/definitions/identifiers/ -->
	<xsd:simpleType name="pidType">
		<xsd:restriction base="xsd:string">
			<xsd:maxLength value="64"/>
			<xsd:pattern value="([A-Za-z0-9]|-|\.)+:(([A-Za-z0-9])|-|\.|~|_|(%[0-9A-F]{2}))+"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="idType">
		<xsd:restriction base="xsd:ID">
			<xsd:maxLength value="64"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="uriListType">
		<xsd:list itemType="xsd:anyURI"/>
	</xsd:simpleType>
</xsd:schema>
New to GrepCode? Check out our FAQ X