Last active
June 3, 2021 18:08
-
-
Save CanOfBees/bc1027b639de4bcad70f5d6144a51e37 to your computer and use it in GitHub Desktop.
Validate MTSU_16
This file contains hidden or 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
xquery version "3.1"; | |
declare variable $oai-resp := fetch:xml("http://cdm15838.contentdm.oclc.org/oai/oai.php?verb=ListRecords&set=p15838coll16&metadataPrefix=oai_dc"); | |
(: two items - | |
: 1. you'll want to add the saxon-8.7.jar to $BaseX/lib/custom, and, | |
: 2. you'll want to modify these paths if you want to double-check this | |
:) | |
declare variable $xslt := "/home/bridger/Documents/metadata-notes/DLTN/XSLT/mtsup15838coll16dctomods.xsl"; | |
declare variable $schema := "/home/bridger/Documents/metadata-notes/DLTN/tests/testSchemas/DLTN_oai_mods.xsd"; | |
$oai-resp => xslt:transform($xslt) => validate:xsd-report(file:read-text($schema)), | |
(: alternate method :) | |
file:write( | |
"/tmp/mtsu_16.oai.xml", | |
$oai-resp, | |
map {"method": "xml" } | |
), | |
file:write( | |
"/tmp/mtsu_16.transformed.xml", | |
xslt:transform("/tmp/mtsu_16.oai.xml", $xslt), | |
map { "method": "xml" } | |
), | |
proc:execute( | |
"xmllint", ("--noout", "--schema", $schema, "/tmp/mtsu_16.transformed.xml") | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment