Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OAI toolchain error: "Undefined namespace prefix" #502

Open
bondjimbond opened this issue Jun 5, 2019 · 1 comment
Open

OAI toolchain error: "Undefined namespace prefix" #502

bondjimbond opened this issue Jun 5, 2019 · 1 comment

Comments

@bondjimbond
Copy link
Collaborator

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
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant