Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add xlink:type to mets:div element #30

Open
aelkiss opened this issue Oct 18, 2018 · 3 comments
Open

Add xlink:type to mets:div element #30

aelkiss opened this issue Oct 18, 2018 · 3 comments

Comments

@aelkiss
Copy link
Contributor

aelkiss commented Oct 18, 2018

The METS div element allows xlink:label, but the XLink spec does require xlink:type in this case (https://www.w3.org/TR/xlink11/#xlinkattusagepat). It seems like the purpose of having the xlink:label on the div is to allow reference from smLink elements, so I think this is a "resource"-type element (https://www.w3.org/TR/xlink11/#local-resource) and we could include the "resourceLink" attribute group from the XLink schema.

This could cause problems if adding that attribute group causes validation to fail for existing documents, so we should verify behavior.

@aelkiss
Copy link
Contributor Author

aelkiss commented Nov 29, 2018

The following minimal example (example A) is valid with the schema version 1.12:

<?xml version="1.0"?>
<mets xmlns="http://www.loc.gov/METS/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/terms/"
  xsi:schemaLocation="http://www.loc.gov/METS/ http://www.loc.gov/standards/mets/mets.xsd
                      http://www.w3.org/1999/xlink http://www.loc.gov/standards/xlink/xlink.xsd">
  <metsHdr /> 
  <structMap>
    <div xlink:label="something"/>
  </structMap>
</mets>

Because the current schema does not permit xlink:type, the following is not:

<?xml version="1.0"?>
<mets xmlns="http://www.loc.gov/METS/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/terms/"
  xsi:schemaLocation="http://www.loc.gov/METS/ http://www.loc.gov/standards/mets/mets.xsd
                      http://www.w3.org/1999/xlink http://www.loc.gov/standards/xlink/xlink.xsd">
  <metsHdr /> 
  <structMap>
    <div xlink:label="something" xlink:type="resource"/>
  </structMap>
</mets>

If we make the following change to mets.xsd, both examples (with xlink:label only and with xlink:type) validate (at least for me with oXygen)

--- mets.xsd	2018-07-25 18:43:19.000000000 -0400
+++ mets-div-xlink-type.xsd	2018-11-29 10:31:46.862927254 -0500
@@ -776,11 +776,7 @@
 				</xsd:documentation>
 			</xsd:annotation>
 	    </xsd:attribute>
-		<xsd:attribute ref="xlink:label">
-			<xsd:annotation>
-				<xsd:documentation xml:lang="en">xlink:label - an xlink label to be referred to by an smLink element</xsd:documentation>
-			</xsd:annotation>
-		</xsd:attribute>
+		<xsd:attributeGroup ref="xlink:resourceLink"/>
 	</xsd:complexType>
 	<xsd:complexType name="parType">
 		<xsd:annotation>

@aelkiss
Copy link
Contributor Author

aelkiss commented Nov 29, 2018

If we are unable to reproduce any validation problems with the issue reported in #19, I think this should be OK, but if we do get an example with an error there it might also be an issue with this proposed change.

@aelkiss
Copy link
Contributor Author

aelkiss commented Jan 24, 2019

Specific question we need to answer - would adding the resourceLink attribute group (from http://www.loc.gov/standards/xlink/xlink.xsd) to mets:div cause any backwards compatibility issues?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant