LISTSERV mailing list manager LISTSERV 16.0

Help for MODS Archives


MODS Archives

MODS Archives


MODS@LISTSERV.LOC.GOV


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Monospaced Font

LISTSERV Archives

LISTSERV Archives

MODS Home

MODS Home

MODS  January 2004

MODS January 2004

Subject:

Re: MODS "strict"

From:

Andrew E Switala <[log in to unmask]>

Reply-To:

Metadata Object Description Schema List <[log in to unmask]>

Date:

Sun, 25 Jan 2004 11:21:08 -0500

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (97 lines)

Hello,

    I take back what I said about adding elements to enforce type
checking. There's a better, user-extensible way of doing it. To make,
say,
    <identifier type="isbn">4872871030</identifier>
valid while
    <identifier type="isbn">872871030</identifier> <!--oops, missing
region prefix-->
is not, validate against the following schema...

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.loc.gov/mods/v3"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.loc.gov/mods/v3" elementFormDefault="qualified"
attributeFormDefault="unqualified">
        <xsd:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/xml.xsd"/>
        <xsd:import namespace="http://www.w3.org/1999/xlink"
schemaLocation="http://www.loc.gov/standards/mods/xlink.xsd"/>
        <xsd:include
schemaLocation="http://www.loc.gov/standards/mods/v3/mods-3-0.xsd"/>
        <xsd:complexType name="isbnIdentifier">
                <xsd:simpleContent>
                        <xsd:restriction base="identifierType">
                                <xsd:pattern value="[0-9]{9}[0-9X]"/>
                                <xsd:attribute name="type"
fixed="isbn"/>
                        </xsd:restriction>
                </xsd:simpleContent>
        </xsd:complexType>
</xsd:schema>

...and use xsi:type to explicitly set the datatype of <identifier>,
(assuming you've set
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"):
    <identifier type="isbn"
xsi:type="isbnIdentifier">4872871030</identifier>
    <identifier type="isbn"
xsi:type="isbnIdentifier">872871030</identifier> <!--no longer
schema-valid-->
Whether the type="isbn" attribute is redundant depends on how one is
using schemata. If the file is checked for validity independent of
other processing, 'type' should be included if it was before. If
subsequent processing is done to the post-validation, augmented
information set, explicit 'type' is optional if its value is declared
fixed as in the example schema above.

Benefits:
* The MODS schema proper is not modified in any way.
* Documents valid under the modified schema are still valid under MODS
if types are derived by restriction only.
* The user need n