-
Notifications
You must be signed in to change notification settings - Fork 0
/
MARC21enhanced.xsd
236 lines (234 loc) · 10.4 KB
/
MARC21enhanced.xsd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<?xml version="1.0"?>
<xsd:schema targetNamespace="MARCXML Enhanced" xmlns="MARCXML Enhanced" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.1" xml:lang="en">
<xsd:annotation>
<xsd:documentation>
MARCXML Enhanced: The MARC 21 XML Schema
Prepared by Chad Petrovay, Morgan Library & Museum
February 16, 2022 - Version 1.0 - Initial Release
This schema supports XML markup of MARC21 records as specified in the MARC documentation (see www.loc.gov), and is based upon the MARCXML schema (http://www.loc.gov/MARC21/slim).
It allows tags with alphabetics and subfield codes that are symbols, neither of which are as yet used in the MARC 21 communications formats, but are allowed by MARC 21 for local data. The schema accommodates all types of MARC 21 records: bibliographic, holdings, bibliographic with embedded holdings, authority, classification, and community information.
Additionally, it has elements for decoding fixed length control fields and recording errors identified during the transformation from MARC to XML.
</xsd:documentation>
</xsd:annotation>
<xsd:element name="record" type="recordType" nillable="true" id="record.e">
<xsd:annotation>
<xsd:documentation>record is a top level container element for all of the field elements which compose the record</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="collection" type="collectionType" nillable="true" id="collection.e">
<xsd:annotation>
<xsd:documentation>collection is a top level container element for 0 or many records</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:complexType name="collectionType" id="collection.ct">
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:element ref="record"/>
</xsd:sequence>
<xsd:attribute name="id" type="idDataType" use="optional"/>
</xsd:complexType>
<xsd:complexType name="recordType" id="record.ct">
<xsd:sequence minOccurs="0">
<xsd:element name="leader" type="leaderFieldType"/>
<xsd:element name="controlfield" type="controlFieldType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="datafield" type="dataFieldType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="errors" type="errorsType" minOccurs="0" maxOccurs="1" />
</xsd:sequence>
<xsd:attribute name="type" type="recordTypeType" use="optional"/>
<xsd:attribute name="id" type="idDataType" use="optional"/>
</xsd:complexType>
<xsd:simpleType name="recordTypeType" id="type.st">
<xsd:restriction base="xsd:NMTOKEN">
<xsd:enumeration value="Bibliographic"/>
<xsd:enumeration value="Authority"/>
<xsd:enumeration value="Holdings"/>
<xsd:enumeration value="Classification"/>
<xsd:enumeration value="Community"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="leaderFieldType" id="leader.ct">
<xsd:annotation>
<xsd:documentation>MARC21 Leader, 24 bytes</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="leaderDataType">
<xsd:attribute name="id" type="idDataType" use="optional"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:simpleType name="leaderDataType" id="leader.st">
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="preserve"/>
<xsd:pattern
value="[\d ]{5}[\dA-Za-z ]{1}[\dA-Za-z]{1}[\dA-Za-z ]{3}(2| )(2| )[\d ]{5}[\dA-Za-z ]{3}(4500| )"
/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="controlFieldType" mixed="true">
<xsd:annotation>
<xsd:documentation>MARC21 Fields 001-009</xsd:documentation>
</xsd:annotation>
<xsd:choice>
<xsd:group ref="fixedlengthGroup" minOccurs="0" maxOccurs="1"></xsd:group>
</xsd:choice>
<xsd:attribute name="id" type="idDataType" use="optional"/>
<xsd:attribute name="tag" type="controltagDataType" use="required"/>
</xsd:complexType>
<xsd:simpleType name="controlDataType">
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="preserve"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="controltagDataType" id="controltag.st">
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="preserve"/>
<xsd:pattern value="00[1-9A-Za-z]{1}"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:group name="fixedlengthGroup">
<xsd:sequence>
<xsd:element name="encoded" minOccurs="1" maxOccurs="1">
<xsd:simpleType>
<xsd:annotation>
<xsd:documentation>Fixed-length fields in their raw state; used when fixed-length field is decoded</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="preserve"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="decoded" minOccurs="1" maxOccurs="1">
<xsd:complexType>
<xsd:annotation>
<xsd:documentation>Fixed-length fields translated into human-readable values</xsd:documentation>
</xsd:annotation>
<xsd:sequence maxOccurs="unbounded">
<xsd:element name="field" type="fieldDataType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:group>
<xsd:complexType name="fieldDataType" mixed="true">
<xsd:choice>
<xsd:sequence maxOccurs="unbounded">
<xsd:element name="item" type="xsd:string"/>
</xsd:sequence>
<xsd:group ref="dateGroup" minOccurs="0" maxOccurs="1"></xsd:group>
</xsd:choice>
<xsd:attribute name="position" type="positionDataType" use="required"/>
<xsd:attribute name="type" type="xsd:string" use="required"/>
</xsd:complexType>
<xsd:simpleType name="positionDataType">
<xsd:restriction base="xsd:string">
<xsd:pattern
value="(\d{2}(-\d{2})?)"
/>
</xsd:restriction>
</xsd:simpleType>
<xsd:group name="dateGroup">
<xsd:sequence>
<xsd:element name="desc" minOccurs="1" maxOccurs="1">
<xsd:complexType>
<xsd:annotation>
<xsd:documentation>Value of 008 position 06: Type of date/Publication status</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="code" type="datecodeDataType" use="required"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="dated" minOccurs="1" maxOccurs="1">
<xsd:complexType>
<xsd:annotation>
<xsd:documentation>Value of 008 position 07-14 formatted for display</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="when" type="dateDataType"/>
<xsd:attribute name="from" type="dateDataType"/>
<xsd:attribute name="to" type="dateDataType"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:group>
<xsd:simpleType name="datecodeDataType">
<xsd:restriction base="xsd:string">
<xsd:pattern value="[a-z|]{1}"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="dateDataType">
<xsd:restriction base="xsd:string">
<xsd:pattern value="\d{4}"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="dataFieldType" id="datafield.ct">
<xsd:annotation>
<xsd:documentation>MARC21 Variable Data Fields 010-999</xsd:documentation>
</xsd:annotation>
<xsd:sequence maxOccurs="unbounded">
<xsd:element name="subfield" type="subfieldatafieldType"/>
</xsd:sequence>
<xsd:attribute name="id" type="idDataType" use="optional"/>
<xsd:attribute name="tag" type="tagDataType" use="required"/>
<xsd:attribute name="ind1" type="indicatorDataType" use="required"/>
<xsd:attribute name="ind2" type="indicatorDataType" use="required"/>
</xsd:complexType>
<xsd:simpleType name="tagDataType" id="tag.st">
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="preserve"/>
<xsd:pattern
value="(0([1-9A-Z][0-9A-Z])|0([1-9a-z][0-9a-z]))|(([1-9A-Z][0-9A-Z]{2})|([1-9a-z][0-9a-z]{2}))"
/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="indicatorDataType" id="ind.st">
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="preserve"/>
<xsd:pattern value="[\da-z ]{1}"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="subfieldatafieldType" id="subfield.ct">
<xsd:simpleContent>
<xsd:extension base="subfieldDataType">
<xsd:attribute name="id" type="idDataType" use="optional"/>
<xsd:attribute name="code" type="subfieldcodeDataType" use="required"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:simpleType name="subfieldDataType" id="subfield.st">
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="preserve"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="subfieldcodeDataType" id="code.st">
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="preserve"/>
<xsd:pattern value="[\dA-Za-z!"#$%&'()*+,-./:;<=>?{}_^`~\[\]\\]{1}"/>
<!-- "A-Z" added after "\d" May 21, 2009 -->
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="idDataType" id="id.st">
<xsd:restriction base="xsd:ID"/>
</xsd:simpleType>
<xsd:complexType name="errorsType">
<xsd:annotation>
<xsd:documentation>Contains any errors discovered in MARC during the transformation to XML</xsd:documentation>
</xsd:annotation>
<xsd:sequence maxOccurs="unbounded">
<xsd:element name="error" type="errorType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="errorType">
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="tag" type="tagDataType" use="required"/>
<xsd:attribute name="subfield" type="subfieldcodeDataType" use="optional"/>
<xsd:attribute name="indicator" type="xsd:integer" use="optional"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:schema>