Overview
JPCOAR Schema publishes XML Schema Definitions in the following repository. Thank you for creating the schema and making the data available.
https://github.com/JPCOAR/schema
This article is a memo of trying XML file validation using the above schema. (Since this is my first time doing this kind of validation, it may contain inaccurate terminology or information. I apologize.)
A Google Colab notebook is also prepared.
Preparation
Clone the repository
Install the library
Load the XSD file (v1)
Trying v1
OK Example
NG Example
Error from placing jpcoar:subject after dc:type?
XsdValidationErrorWithInfo: /content/ng.xml: line 9 column 41: cvc-complex-type.2.4.a: Invalid content was found starting with element ‘{"https://github.com/JPCOAR/schema/blob/master/1.0/":subject}’. One of ‘{"https://schema.datacite.org/meta/kernel-4/":version, “http://namespace.openaire.eu/schema/oaire/":version, “https://github.com/JPCOAR/schema/blob/master/1.0/":identifier, “https://github.com/JPCOAR/schema/blob/master/1.0/":identifierRegistration, “https://github.com/JPCOAR/schema/blob/master/1.0/":relation, “http://purl.org/dc/terms/":temporal, “https://schema.datacite.org/meta/kernel-4/":geoLocation, “https://github.com/JPCOAR/schema/blob/master/1.0/":fundingReference, “https://github.com/JPCOAR/schema/blob/master/1.0/":sourceIdentifier, “https://github.com/JPCOAR/schema/blob/master/1.0/":sourceTitle, “https://github.com/JPCOAR/schema/blob/master/1.0/":volume, “https://github.com/JPCOAR/schema/blob/master/1.0/":issue, “https://github.com/JPCOAR/schema/blob/master/1.0/":numPages, “https://github.com/JPCOAR/schema/blob/master/1.0/":pageStart, “https://github.com/JPCOAR/schema/blob/master/1.0/":pageEnd, “http://ndl.go.jp/dcndl/terms/":dissertationNumber, “http://ndl.go.jp/dcndl/terms/":degreeName, “http://ndl.go.jp/dcndl/terms/":dateGranted, “https://github.com/JPCOAR/schema/blob/master/1.0/":degreeGrantor, “https://github.com/JPCOAR/schema/blob/master/1.0/":conference, “https://github.com/JPCOAR/schema/blob/master/1.0/":file}’ is expected.
Fix
Try placing dc:type after jpcoar:subject
Summary
Based on the error messages, we were able to fix the XML file.
The Google Colab notebook also includes validation examples targeting JPCOAR Schema Version 2.0.
There may be some inaccurate content, but I hope this serves as a helpful reference for XML file validation.