Skip to content

Error while parsing metadata #67

@mdcarreira

Description

@mdcarreira

Giving the following response XML from an OAI repository:

<?xml version="1.0" encoding="UTF-8"?>
<OAI-PMH xmlns="http://www.openarchives.org/OAI/2.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd">
   ...
   <ListRecords>
      <record>
         <header>
            ...
         </header>
         <metadata>
            <crossref xmlns="http://www.crossref.org/xschema/1.1" xsi:schemaLocation="http://www.crossref.org/xschema/1.1 http://www.crossref.org/schema/unixref1.1.xsd">
               ...
            </crossref>
         </metadata>
      </record>
   </ListRecords>
</OAI-PMH>

We get an error if we try to parse it using XOAI.

ERROR: 'The prefix "xsi" for attribute "xsi:schemaLocation" associated with an element type "crossref" is not bound.'

From what I could deduce from reading the source code and debugging, each metadata node is parsed individually by the XOAI library. And, in that context, the xsi prefix is indeed not bound, as it is only defined in parent node OAI-PMH.

There should be a way to configure the XML reader to ignore namespace errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions