Skip to content

Instantly share code, notes, and snippets.

@greystate
Forked from pauljcripps/overview
Last active August 29, 2015 14:20
Show Gist options
  • Save greystate/39cf5922fb428c7c7b73 to your computer and use it in GitHub Desktop.
Save greystate/39cf5922fb428c7c7b73 to your computer and use it in GitHub Desktop.
aim is to add UID using the generate-id function to the parent element (Object) and also to descendants so when imported into a database there are primary/foreign keys to knit it all back together again.
xslt currently properly assigns UID to Object and children but then assigns a new (but the same) UID to further descendants within each Child block; ie all children of child 1 get UID X, all children of child 2 get UID Y, etc.
So nearly there but not quite...
Files:
Schema (xsd)
Transform (xslt)
<!--
this is the schema file inferred by Visual Studio 2013 from the xml interchange file:
-->
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Interchange">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="Object">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="ObjectIdentity">
<xs:complexType>
<xs:sequence>
<xs:element name="Number">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="ItemMarked" />
<xs:element minOccurs="0" name="Institution" type="xs:string" />
<xs:element minOccurs="0" name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="OtherIdentity">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element minOccurs="0" name="Authority">
<xs:complexType>
<xs:sequence>
<xs:element name="PersonName" type="xs:string" />
<xs:element name="Date" type="xs:unsignedShort" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="Institution" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="unbounded" name="Number">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="Note" type="xs:string" />
</xs:sequence>
<xs:attribute name="elementtype" type="xs:string" use="optional" />
</xs:complexType>
</xs:element>
<xs:element name="RelatedObject">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="ObjectIdentity">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:element name="Institution" type="xs:string" />
<xs:element name="Number" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="NumberOfItems">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Identification">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element maxOccurs="unbounded" name="ObjectName">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:element minOccurs="0" maxOccurs="unbounded" name="Keyword">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element maxOccurs="unbounded" name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="Type" type="xs:string" />
</xs:sequence>
<xs:attribute name="elementtype" type="xs:string" use="optional" />
</xs:complexType>
</xs:element>
<xs:element name="CollectionName" type="xs:string" />
<xs:element maxOccurs="unbounded" name="Classification">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="System" type="xs:string" />
<xs:element maxOccurs="unbounded" name="Keyword">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element maxOccurs="unbounded" name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="keyword" />
<xs:element name="Note" type="xs:string" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="BriefDescription">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element maxOccurs="unbounded" name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Note" type="xs:string" />
<xs:element name="Authority">
<xs:complexType>
<xs:sequence>
<xs:element name="PersonName" type="xs:string" />
<xs:element minOccurs="0" name="Date" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Title" />
<xs:element name="Part" type="xs:string" />
<xs:element name="References">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="Reference">
<xs:complexType>
<xs:sequence>
<xs:element name="Author" type="xs:string" />
<xs:element name="Date" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="Link" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Commentary" type="xs:string" />
<xs:element name="FieldCollection">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="Method">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Date">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="Note" type="xs:string" />
<xs:element name="DateBegin">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DateEnd">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Place">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="Street">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Parish">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="County" type="xs:string" />
<xs:element maxOccurs="unbounded" name="SiteName">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element maxOccurs="unbounded" name="LocalityType">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element minOccurs="0" name="Note" type="xs:string" />
<xs:element minOccurs="0" name="Type" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Context">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element maxOccurs="unbounded" name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element maxOccurs="unbounded" name="Note" type="xs:string" />
<xs:element name="Coordinates">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="System">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Note" type="xs:string" />
<xs:element maxOccurs="unbounded" name="Keyword">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element maxOccurs="unbounded" name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="References" type="xs:string" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="PlaceIdentity">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element minOccurs="0" name="Institution" type="xs:string" />
<xs:element maxOccurs="unbounded" name="Number" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Country" type="xs:string" />
<xs:element name="PlaceName">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
<xs:attribute name="elementtype" type="xs:string" use="optional" />
</xs:complexType>
</xs:element>
<xs:element name="References">
<xs:complexType>
<xs:sequence>
<xs:element name="Link" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Altitude">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:element name="Keyword">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Person">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="Role" type="xs:string" />
<xs:element maxOccurs="unbounded" name="PersonName">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element maxOccurs="unbounded" name="Address" type="xs:string" />
<xs:element name="Dates" />
<xs:element name="Note" type="xs:string" />
<xs:element name="PersonTitle" type="xs:string" />
<xs:element name="Organisation" type="xs:string" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Period" type="xs:string" />
<xs:element name="CollectionNumber">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element minOccurs="0" name="Institution" type="xs:string" />
<xs:element name="Number" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Organisation">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="Role" type="xs:string" />
<xs:element name="OrganisationName">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Note" type="xs:string" />
<xs:element name="Address" type="xs:string" />
<xs:element name="Person">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="PersonName" type="xs:string" />
<xs:element name="Role" type="xs:string" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Note" type="xs:string" />
<xs:element name="ProjectName" type="xs:string" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Association">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="Date">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element minOccurs="0" name="Note" type="xs:string" />
<xs:element minOccurs="0" name="DateBegin" type="xs:string" />
<xs:element minOccurs="0" name="DateEnd">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element maxOccurs="unbounded" name="Period" type="xs:string" />
<xs:element name="Place">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="Street" type="xs:string" />
<xs:element name="Parish" type="xs:string" />
<xs:element name="County" type="xs:string" />
<xs:element name="SiteName">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element maxOccurs="unbounded" name="LocalityType" type="xs:string" />
<xs:element name="Note" type="xs:string" />
<xs:element name="Coordinates">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:element minOccurs="0" name="System" type="xs:string" />
<xs:element minOccurs="0" name="Keyword">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Context" type="xs:string" />
<xs:element name="PlaceIdentity">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:element name="Number" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="PlaceName">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="elementtype" type="xs:string" use="optional" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Country" type="xs:string" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Person">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element minOccurs="0" name="Role" type="xs:string" />
<xs:element maxOccurs="unbounded" name="PersonName">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="Date">
<xs:complexType>
<xs:sequence>
<xs:element name="DateBegin" type="xs:string" />
<xs:element name="DateEnd" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="Address" type="xs:string" />
<xs:element minOccurs="0" name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Organisation">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="Role" type="xs:string" />
<xs:element name="OrganisationName" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Note" type="xs:string" />
<xs:element name="Type" />
<xs:element name="Item">
<xs:complexType>
<xs:sequence>
<xs:element name="ObjectName">
<xs:complexType>
<xs:sequence>
<xs:element name="Keyword" type="xs:string" />
</xs:sequence>
<xs:attribute name="elementtype" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Event">
<xs:complexType>
<xs:sequence>
<xs:element name="EventName" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Acquisition">
<xs:complexType>
<xs:sequence>
<xs:choice maxOccurs="unbounded">
<xs:element name="Method">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Person">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="Role" type="xs:string" />
<xs:element name="PersonName">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Address">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Note" type="xs:string" />
<xs:element name="Date" type="xs:string" />
<xs:element name="Phone" type="xs:string" />
<xs:element name="PersonTitle" type="xs:string" />
<xs:element name="Organisation" type="xs:string" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Date">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element minOccurs="0" name="DateBegin" type="xs:string" />
<xs:element minOccurs="0" name="DateEnd" type="xs:string" />
<xs:element minOccurs="0" name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Organisation">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="Role" type="xs:string" />
<xs:element name="OrganisationName">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Address" type="xs:string" />
<xs:element name="Date" type="xs:string" />
<xs:element name="Note" type="xs:string" />
<xs:element name="Person">
<xs:complexType>
<xs:sequence>
<xs:element name="PersonName" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Price">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Value" type="xs:string" />
<xs:element name="Unit" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="CollectionName" type="xs:string" />
<xs:element name="Note" type="xs:string" />
<xs:element name="GrantAid">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="Organisation">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="Role" type="xs:string" />
<xs:element name="OrganisationName" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Person">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="PersonName" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Value" type="xs:string" />
<xs:element name="Unit" type="xs:string" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Funding">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element maxOccurs="unbounded" name="Organisation">
<xs:complexType>
<xs:sequence>
<xs:element name="OrganisationName" type="xs:string" />
<xs:element minOccurs="0" name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="Value" type="xs:string" />
<xs:element minOccurs="0" name="Conditions" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="References">
<xs:complexType>
<xs:sequence>
<xs:element name="Link" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Conditions" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Description">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="Condition">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element minOccurs="0" name="Keyword" type="xs:string" />
<xs:element minOccurs="0" name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element maxOccurs="unbounded" name="Material">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element maxOccurs="unbounded" name="Keyword">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Note" type="xs:string" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Inscription">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="Position" type="xs:string" />
<xs:element name="Method" type="xs:string" />
<xs:element name="SummaryText" type="xs:string" />
<xs:element name="Transcription" type="xs:string" />
<xs:element name="Type" type="xs:string" />
<xs:element name="Note" type="xs:string" />
<xs:element name="Translation" type="xs:string" />
<xs:element name="Language" />
<xs:element name="Script" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element maxOccurs="unbounded" name="Measurement">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="Dimension">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Reading">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="Value" type="xs:string" />
<xs:element name="Unit" type="xs:string" />
<xs:element name="Note" type="xs:string" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Note" type="xs:string" />
<xs:element name="Part" type="xs:string" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="References">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:element minOccurs="0" maxOccurs="unbounded" name="Reference">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="Author" type="xs:string" />
<xs:element name="Date">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="DateEnd" type="xs:unsignedShort" />
<xs:element name="DateBegin" type="xs:unsignedShort" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Title" type="xs:string" />
<xs:element maxOccurs="unbounded" name="Publisher" type="xs:string" />
<xs:element name="Volume" type="xs:string" />
<xs:element name="Note" type="xs:string" />
<xs:element name="Page">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Journal" type="xs:string" />
<xs:element name="ReferenceNumber" type="xs:string" />
<xs:element name="References">
<xs:complexType>
<xs:sequence>
<xs:element name="Reference" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="Note" type="xs:string" />
<xs:element minOccurs="0" name="Link" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Completeness" type="xs:string" />
<xs:element name="Note">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Type" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Part" />
<xs:element name="Authority" type="xs:string" />
<xs:element name="Aspect">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Type" type="xs:string" />
<xs:element name="KeywordList">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:element maxOccurs="unbounded" name="Keyword" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Colour" type="xs:string" />
<xs:element name="Type" type="xs:string" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Conservation">
<xs:complexType>
<xs:sequence>
<xs:choice maxOccurs="unbounded">
<xs:element maxOccurs="unbounded" name="ConservationNumber">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element minOccurs="0" name="Institution" type="xs:string" />
<xs:element maxOccurs="unbounded" name="Number" type="xs:string" />
<xs:element minOccurs="0" name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SummaryText" />
<xs:element name="Date" type="xs:decimal" />
<xs:element name="Organisation">
<xs:complexType>
<xs:sequence>
<xs:element name="OrganisationName" type="xs:string" />
<xs:element minOccurs="0" name="Date" type="xs:string" />
<xs:element minOccurs="0" name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Note">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Type" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="References">
<xs:complexType>
<xs:sequence>
<xs:element name="Link" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Person">
<xs:complexType>
<xs:sequence>
<xs:element name="PersonName" type="xs:string" />
<xs:element name="PersonTitle" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Reproduction">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element maxOccurs="unbounded" name="Filename">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element minOccurs="0" name="Note" type="xs:string" />
<xs:element minOccurs="0" name="Type" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element maxOccurs="unbounded" name="ReproductionNumber">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="Type" type="xs:string" />
<xs:element name="Number" type="xs:string" />
<xs:element name="Note" type="xs:string" />
<xs:element name="Institution" />
</xs:choice>
</xs:sequence>
<xs:attribute name="elementtype" type="xs:string" use="optional" />
</xs:complexType>
</xs:element>
<xs:element name="Note">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Type" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Type" type="xs:string" />
<xs:element name="SummaryText" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ObjectLocation">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="Location">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element maxOccurs="unbounded" name="Keyword">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Date">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="DateBegin">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" maxOccurs="unbounded" name="Note" type="xs:string" />
<xs:element minOccurs="0" name="DateEnd" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Note" type="xs:string" />
<xs:element name="Reason" type="xs:string" />
<xs:element name="References">
<xs:complexType>
<xs:sequence>
<xs:element name="Reference">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element minOccurs="0" name="Journal" type="xs:string" />
<xs:element minOccurs="0" name="Title" type="xs:string" />
<xs:element name="Volume" type="xs:unsignedByte" />
<xs:element name="Page" type="xs:string" />
<xs:element minOccurs="0" name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
<xs:attribute name="elementtype" type="xs:string" use="optional" />
<xs:attribute name="confidentiality" type="xs:string" use="optional" />
</xs:complexType>
</xs:element>
<xs:element name="Recorder">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="Initials" type="xs:string" />
<xs:element name="Date" type="xs:string" />
<xs:element name="Authority">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="PersonName">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Date" type="xs:string" />
<xs:element name="Note" type="xs:string" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Note" type="xs:string" />
<xs:element name="PersonName" type="xs:string" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Administration">
<xs:complexType>
<xs:sequence>
<xs:element name="ItemCategory">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element minOccurs="0" name="Type" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="unbounded" name="Keyword" type="xs:string" />
<xs:element minOccurs="0" name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Production">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="Person">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Role" type="xs:string" />
<xs:element minOccurs="0" name="PersonName" type="xs:string" />
<xs:element minOccurs="0" name="Address" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Method" type="xs:string" />
<xs:element name="Date">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="Note" type="xs:string" />
<xs:element name="DateBegin" type="xs:string" />
<xs:element name="DateEnd">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Period" type="xs:string" />
<xs:element name="Place">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="Coordinates">
<xs:complexType>
<xs:sequence>
<xs:element name="System" type="xs:string" />
<xs:element name="Keyword" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Street" />
<xs:element name="Parish" type="xs:string" />
<xs:element name="County" type="xs:string" />
<xs:element name="Country" type="xs:string" />
<xs:element name="SiteName" type="xs:string" />
<xs:element name="PlaceName" type="xs:string" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Group">
<xs:complexType>
<xs:sequence>
<xs:element name="Role" />
<xs:element name="GroupName" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Note" type="xs:string" />
<xs:element name="Organisation">
<xs:complexType>
<xs:sequence>
<xs:element name="OrganisationName" type="xs:string" />
<xs:element name="Address" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SummaryText" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="References">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="Reference">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="SummaryText" type="xs:string" />
<xs:element name="Journal" type="xs:string" />
<xs:element name="Title">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element maxOccurs="unbounded" name="Author">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Date">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="DateEnd" type="xs:string" />
<xs:element name="DateBegin" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Publisher" type="xs:string" />
<xs:element name="Volume" type="xs:string" />
<xs:element name="Page">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Note" type="xs:string" />
<xs:element name="Type" type="xs:string" />
<xs:element name="ReferenceNumber" type="xs:string" />
<xs:element name="AuthorName" type="xs:string" />
<xs:element name="References">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:element name="Reference" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Link" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element maxOccurs="unbounded" name="Link" type="xs:string" />
<xs:element name="Note" type="xs:string" />
<xs:element name="ReferenceNumber">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:element name="Number" type="xs:string" />
<xs:element minOccurs="0" name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Filename" type="xs:string" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Ownership">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:element name="Person">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:element name="PersonName" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="ReferenceNumber">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:element name="Number" type="xs:unsignedByte" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Exhibition">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element minOccurs="0" name="ProjectName" type="xs:string" />
<xs:element minOccurs="0" name="ExhibitionName" type="xs:string" />
<xs:element minOccurs="0" name="ExhibitionNumber" type="xs:string" />
<xs:element minOccurs="0" name="Date">
<xs:complexType>
<xs:sequence>
<xs:element name="DateBegin" type="xs:string" />
<xs:element name="DateEnd" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Evidence">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:element name="ReferenceNumber">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:element name="Number" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Notes" type="xs:string" />
<xs:element name="LoanOut">
<xs:complexType>
<xs:sequence>
<xs:choice maxOccurs="unbounded">
<xs:element name="Organisation">
<xs:complexType>
<xs:sequence>
<xs:element name="OrganisationName" type="xs:string" />
<xs:element minOccurs="0" name="Address" type="xs:string" />
<xs:element minOccurs="0" name="Dates" type="xs:string" />
<xs:element minOccurs="0" name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ProjectName" type="xs:string" />
<xs:element name="Type" type="xs:string" />
<xs:element name="LoanSigned">
<xs:complexType>
<xs:sequence>
<xs:element name="Date" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="RenewalDate">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Conditions">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Note" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Reason" type="xs:string" />
<xs:element name="Date">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="DateBegin" type="xs:string" />
<xs:element name="DateEnd" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Authority">
<xs:complexType>
<xs:sequence>
<xs:element name="PersonName" type="xs:string" />
<xs:element name="PersonIdentity" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ReturnDate" type="xs:string" />
<xs:element name="Note" type="xs:string" />
<xs:element name="Person">
<xs:complexType mixed="true">
<xs:sequence>
<xs:element name="Address" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="LoanNumber" type="xs:string" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Content">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="Note">
<xs:complexType mixed="true">
<xs:sequence>
<xs:element name="Type" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="Person" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ConditionCheck">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="Note">
<xs:complexType mixed="true">
<xs:sequence>
<xs:element name="Type" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Condition">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0">
<xs:element name="Keyword" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="Date" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="RecordType" type="xs:string" />
<xs:element name="Deposit">
<xs:complexType>
<xs:sequence>
<xs:element name="DepositNumber">
<xs:complexType>
<xs:sequence>
<xs:element name="Number" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<xsl:stylesheet version="1.0">
<!-- Identity transform -->
<xsl:template match="* | text()">
<xsl:copy>
<xsl:copy-of select="@*" />
<xsl:apply-templates select="* | text()" />
</xsl:copy>
</xsl:template>
<!-- Add an `<objectuid>` child to any descendant of `<Interchange>` referencing the top `<Object>` -->
<xsl:template match="*[ancestor::Interchange]">
<xsl:copy>
<xsl:apply-templates select="@*" />
<objectuid><xsl:value-of select="generate-id(ancestor-or-self::Object)"/></objectuid>
<xsl:apply-templates select="node()" />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment