Created
April 18, 2019 15:46
-
-
Save aelkiss/4d3fab39219f6cea23bc0e0e9b0ae3f3 to your computer and use it in GitHub Desktop.
compromise xlink schema (loc + w3c)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- METS XLink Schema, v. 2, Nov. 15, 2004 --> | |
<schema targetNamespace="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink" elementFormDefault="qualified"> | |
<!-- import from w3c xlink schema has to go first --> | |
<import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/> | |
<!-- attribute definitions from loc xlink schema superceded by ones from w3c schema --> | |
<!-- attribute groups from LOC xlink schema https://www.loc.gov/standards/xlink/xlink.xsd --> | |
<!-- global attributes --> | |
<attributeGroup name="simpleLink"> | |
<attribute name="type" type="string" fixed="simple" form="qualified" /> | |
<attribute ref="xlink:href" use="optional" /> | |
<attribute ref="xlink:role" use="optional" /> | |
<attribute ref="xlink:arcrole" use="optional" /> | |
<attribute ref="xlink:title" use="optional" /> | |
<attribute ref="xlink:show" use="optional" /> | |
<attribute ref="xlink:actuate" use="optional" /> | |
</attributeGroup> | |
<attributeGroup name="extendedLink"> | |
<attribute name="type" type="string" fixed="extended" form="qualified" /> | |
<attribute ref="xlink:role" use="optional" /> | |
<attribute ref="xlink:title" use="optional" /> | |
</attributeGroup> | |
<attributeGroup name="locatorLink"> | |
<attribute name="type" type="string" fixed="locator" form="qualified" /> | |
<attribute ref="xlink:href" use="required" /> | |
<attribute ref="xlink:role" use="optional" /> | |
<attribute ref="xlink:title" use="optional" /> | |
<attribute ref="xlink:label" use="optional" /> | |
</attributeGroup> | |
<attributeGroup name="arcLink"> | |
<attribute name="type" type="string" fixed="arc" form="qualified" /> | |
<attribute ref="xlink:arcrole" use="optional" /> | |
<attribute ref="xlink:title" use="optional" /> | |
<attribute ref="xlink:show" use="optional" /> | |
<attribute ref="xlink:actuate" use="optional" /> | |
<attribute ref="xlink:from" use="optional" /> | |
<attribute ref="xlink:to" use="optional" /> | |
</attributeGroup> | |
<attributeGroup name="resourceLink"> | |
<attribute name="type" type="string" fixed="resource" form="qualified" /> | |
<attribute ref="xlink:role" use="optional" /> | |
<attribute ref="xlink:title" use="optional" /> | |
<attribute ref="xlink:label" use="optional" /> | |
</attributeGroup> | |
<attributeGroup name="titleLink"> | |
<attribute name="type" type="string" fixed="title" form="qualified" /> | |
</attributeGroup> | |
<attributeGroup name="emptyLink"> | |
<attribute name="type" type="string" fixed="none" form="qualified" /> | |
</attributeGroup> | |
<!-- start of stuff copied from w3c xlink schema http://www.w3.org/1999/xlink.xsd --> | |
<annotation> | |
<documentation>This schema document provides attribute declarations and | |
attribute group, complex type and simple type definitions which can be used in | |
the construction of user schemas to define the structure of particular linking | |
constructs, e.g. | |
<![CDATA[ | |
<schema xmlns:xs="http://www.w3.org/2001/XMLSchema" | |
xmlns:xl="http://www.w3.org/1999/xlink"> | |
<import namespace="http://www.w3.org/1999/xlink" | |
location="http://www.w3.org/1999/xlink.xsd"> | |
<element name="mySimple"> | |
<complexType> | |
... | |
<attributeGroup ref="xl:simpleAttrs"/> | |
... | |
</complexType> | |
</element> | |
... | |
</schema>]]></documentation> | |
</annotation> | |
<attribute name="type" type="xlink:typeType"/> | |
<simpleType name="typeType"> | |
<restriction base="token"> | |
<enumeration value="simple"/> | |
<enumeration value="extended"/> | |
<enumeration value="title"/> | |
<enumeration value="resource"/> | |
<enumeration value="locator"/> | |
<enumeration value="arc"/> | |
</restriction> | |
</simpleType> | |
<attribute name="href" type="xlink:hrefType"/> | |
<simpleType name="hrefType"> | |
<restriction base="anyURI"/> | |
</simpleType> | |
<attribute name="role" type="xlink:roleType"/> | |
<simpleType name="roleType"> | |
<restriction base="anyURI"> | |
<minLength value="1"/> | |
</restriction> | |
</simpleType> | |
<attribute name="arcrole" type="xlink:arcroleType"/> | |
<simpleType name="arcroleType"> | |
<restriction base="anyURI"> | |
<minLength value="1"/> | |
</restriction> | |
</simpleType> | |
<attribute name="title" type="xlink:titleAttrType"/> | |
<simpleType name="titleAttrType"> | |
<restriction base="string"/> | |
</simpleType> | |
<attribute name="show" type="xlink:showType"/> | |
<simpleType name="showType"> | |
<restriction base="token"> | |
<enumeration value="new"/> | |
<enumeration value="replace"/> | |
<enumeration value="embed"/> | |
<enumeration value="other"/> | |
<enumeration value="none"/> | |
</restriction> | |
</simpleType> | |
<attribute name="actuate" type="xlink:actuateType"/> | |
<simpleType name="actuateType"> | |
<restriction base="token"> | |
<enumeration value="onLoad"/> | |
<enumeration value="onRequest"/> | |
<enumeration value="other"/> | |
<enumeration value="none"/> | |
</restriction> | |
</simpleType> | |
<attribute name="label" type="xlink:labelType"/> | |
<simpleType name="labelType"> | |
<restriction base="NCName"/> | |
</simpleType> | |
<attribute name="from" type="xlink:fromType"/> | |
<simpleType name="fromType"> | |
<restriction base="NCName"/> | |
</simpleType> | |
<attribute name="to" type="xlink:toType"/> | |
<simpleType name="toType"> | |
<restriction base="NCName"/> | |
</simpleType> | |
<attributeGroup name="simpleAttrs"> | |
<attribute ref="xlink:type" fixed="simple"/> | |
<attribute ref="xlink:href"/> | |
<attribute ref="xlink:role"/> | |
<attribute ref="xlink:arcrole"/> | |
<attribute ref="xlink:title"/> | |
<attribute ref="xlink:show"/> | |
<attribute ref="xlink:actuate"/> | |
</attributeGroup> | |
<group name="simpleModel"> | |
<sequence> | |
<any processContents="lax" minOccurs="0" maxOccurs="unbounded"/> | |
</sequence> | |
</group> | |
<complexType mixed="true" name="simple"> | |
<annotation> | |
<documentation> | |
Intended for use as the type of user-declared elements to make them | |
simple links. | |
</documentation> | |
</annotation> | |
<group ref="xlink:simpleModel"/> | |
<attributeGroup ref="xlink:simpleAttrs"/> | |
</complexType> | |
<attributeGroup name="extendedAttrs"> | |
<attribute ref="xlink:type" fixed="extended" use="required"/> | |
<attribute ref="xlink:role"/> | |
<attribute ref="xlink:title"/> | |
</attributeGroup> | |
<group name="extendedModel"> | |
<choice> | |
<element ref="xlink:title"/> | |
<element ref="xlink:resource"/> | |
<element ref="xlink:locator"/> | |
<element ref="xlink:arc"/> | |
</choice> | |
</group> | |
<complexType name="extended"> | |
<annotation> | |
<documentation> | |
Intended for use as the type of user-declared elements to make them | |
extended links. | |
Note that the elements referenced in the content model are all abstract. | |
The intention is that by simply declaring elements with these as their | |
substitutionGroup, all the right things will happen. | |
</documentation> | |
</annotation> | |
<group ref="xlink:extendedModel" minOccurs="0" maxOccurs="unbounded"/> | |
<attributeGroup ref="xlink:extendedAttrs"/> | |
</complexType> | |
<element name="title" type="xlink:titleEltType" abstract="true"/> | |
<attributeGroup name="titleAttrs"> | |
<attribute ref="xlink:type" fixed="title" use="required"/> | |
<attribute ref="xml:lang"> | |
<annotation> | |
<documentation> | |
xml:lang is not required, but provides much of the | |
motivation for title elements in addition to attributes, and so | |
is provided here for convenience. | |
</documentation> | |
</annotation> | |
</attribute> | |
</attributeGroup> | |
<group name="titleModel"> | |
<sequence> | |
<any processContents="lax" minOccurs="0" maxOccurs="unbounded"/> | |
</sequence> | |
</group> | |
<complexType mixed="true" name="titleEltType"> | |
<group ref="xlink:titleModel"/> | |
<attributeGroup ref="xlink:titleAttrs"/> | |
</complexType> | |
<element name="resource" type="xlink:resourceType" abstract="true"/> | |
<attributeGroup name="resourceAttrs"> | |
<attribute ref="xlink:type" fixed="resource" use="required"/> | |
<attribute ref="xlink:role"/> | |
<attribute ref="xlink:title"/> | |
<attribute ref="xlink:label"/> | |
</attributeGroup> | |
<group name="resourceModel"> | |
<sequence> | |
<any processContents="lax" minOccurs="0" maxOccurs="unbounded"/> | |
</sequence> | |
</group> | |
<complexType mixed="true" name="resourceType"> | |
<group ref="xlink:resourceModel"/> | |
<attributeGroup ref="xlink:resourceAttrs"/> | |
</complexType> | |
<element name="locator" type="xlink:locatorType" abstract="true"/> | |
<attributeGroup name="locatorAttrs"> | |
<attribute ref="xlink:type" fixed="locator" use="required"/> | |
<attribute ref="xlink:href" use="required"/> | |
<attribute ref="xlink:role"/> | |
<attribute ref="xlink:title"/> | |
<attribute ref="xlink:label"> | |
<annotation> | |
<documentation> | |
label is not required, but locators have no particular | |
XLink function if they are not labeled. | |
</documentation> | |
</annotation> | |
</attribute> | |
</attributeGroup> | |
<group name="locatorModel"> | |
<sequence> | |
<element ref="xlink:title" minOccurs="0" maxOccurs="unbounded"/> | |
</sequence> | |
</group> | |
<complexType name="locatorType"> | |
<group ref="xlink:locatorModel"/> | |
<attributeGroup ref="xlink:locatorAttrs"/> | |
</complexType> | |
<element name="arc" type="xlink:arcType" abstract="true"/> | |
<attributeGroup name="arcAttrs"> | |
<attribute ref="xlink:type" fixed="arc" use="required"/> | |
<attribute ref="xlink:arcrole"/> | |
<attribute ref="xlink:title"/> | |
<attribute ref="xlink:show"/> | |
<attribute ref="xlink:actuate"/> | |
<attribute ref="xlink:from"/> | |
<attribute ref="xlink:to"> | |
<annotation> | |
<documentation> | |
from and to have default behavior when values are missing | |
</documentation> | |
</annotation> | |
</attribute> | |
</attributeGroup> | |
<group name="arcModel"> | |
<sequence> | |
<element ref="xlink:title" minOccurs="0" maxOccurs="unbounded"/> | |
</sequence> | |
</group> | |
<complexType name="arcType"> | |
<group ref="xlink:arcModel"/> | |
<attributeGroup ref="xlink:arcAttrs"/> | |
</complexType> | |
</schema> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment