mik icon indicating copy to clipboard operation
mik copied to clipboard

OAI toolchain error: "Undefined namespace prefix"

Open bondjimbond opened this issue 5 years ago • 1 comments

See attached ini, mik.log and example metadata files...

I'm trying to pull down objects via the METS metadataPrefix, since it's the only one that contains useful information from the repository I'm targeting.

Problem: I'm getting the XML, but not the files. I've tried a few different XPaths, one of which should be valid according to this handy tool... but I wonder if there are problems with the fact that this XML contains so many namespaces?

Any suggestions for getting past this?

mru_oai.ini.txt

98.xml.txt

mik.log.txt

bondjimbond avatar Jun 05 '19 17:06 bondjimbond

And I can't even pull it out of the xlink:href attribute in the FLocat element...

So it turns out that XPath really doesn't like it if some of your elements (or attributes) have namespaces and others don't, or if you have a mix of namespaces.

Typical suggestion is to use the local-name() function within your xpath -- that is, something like this:

xpath_expression = "/record/metadata[1]/mets[1]/fileSec[1]/fileGrp[1]/file[1]/FLocat[1]/@*[local-name() = 'href']"

But that doesn't work here. (Seems to be a Java thing maybe?)

Is there any way to get such an option into MIK? Understanding XPaths with multiple namespaces in them would make life a lot easier in the OAI world.

bondjimbond avatar Jun 11 '19 13:06 bondjimbond