Bug 21106 - oai.pl XML output doesn't validate against OAI-PMH XML schema
Summary: oai.pl XML output doesn't validate against OAI-PMH XML schema
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Web services (show other bugs)
Version: Main
Hardware: All All
: P3 normal with 1 vote (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 21102
  Show dependency treegraph
 
Reported: 2018-07-23 19:45 UTC by Pablo AB
Modified: 2023-11-16 21:50 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 21106: Fix Identify and ListMetadata formats complaints (2.47 KB, patch)
2021-04-06 11:25 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Pablo AB 2018-07-23 19:45:26 UTC
When using some verbs Koha return a well formed but in invalid XML.

CLI test:
wget -q "https://www.openarchives.org/OAI/2.0/OAI-PMH.xsd"
wget -q "https://demo.bibkat.no/cgi-bin/koha/oai.pl?verb=ListSets" -O test.xml
xmllint --noout --schema OAI-PMH.xsd test.xml

Web test: An online way to test this is with http://validator.oaipmh.com/

1. verb=ListSets: When no set is defined Koha incorrectly output <ListSets/>. A set (child element of ListSets) should always be there, minOccurs default value is 1. Otherwhise should be:
<error code="noSetHierarchy">No sets defined</error>, AFAIK even if tehere is no error.
2. verb=Identify: setDescription is not a string, is descriptionType ##other, "defined by a community" (?)
See https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17785#c13
Comment 1 Nick Clemens (kidclamp) 2021-04-06 11:25:55 UTC
Created attachment 119209 [details] [review]
Bug 21106: Fix Identify and ListMetadata formats complaints

Validation complains of:
wrong URL in Identify
Wrong links in the second
Comment 2 Tomás Cohen Arazi 2021-11-12 14:57:38 UTC
Nick, the 'Identify' bit is solved on bug 21105.
Comment 3 Pablo AB 2023-11-16 21:50:27 UTC
I recently try again. Beside a warning related to Content type encoding (not sure why) returns an error twice with verb ListMetadataFormats:

> Schema http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd not found!