Comments (6)
Thank you for reporting the issue! This might be a problem with how xml2js
parses the returned XML – or possibly the ._
is just wrong :). Can you check how it works with another OAI PMH provider? I never experienced any problems but maybe the ones I used don't use resumption tokens...
from oai-pmh.
Goodness, _
contains the character content (see "charkey" at https://github.com/Leonidas-from-XIV/node-xml2js) if the element has attributes.
So it works for repositories that returns
<resumptionToken completeListSize="119657" cursor="0">oai_dc////100</resumptionToken>
but not for
<resumptionToken>oai_dc////100</resumptionToken>
The completeListSize
and cursor
attributes are not required by the OAI-PMH spec, so some repos provide them, others not. xml2js
has an option called explicitCharkey
, which I guess makes sure _
is always there, but that could probably also mess up lots of other things? What do you think about just adding a fallback?
resumptionToken: self.currentResult.resumptionToken._ || self.currentResult.resumptionToken,
from oai-pmh.
Jeez, you never stop learning what could go wrong when parsing XML... ;)
I think explicitCharkey
makes sense. The object structure should really be independent from the presence of attributes. I don't have time to test this myself right now (or in the next 2 days) but of course I'm happy to review a PR if you have time to do it!
from oai-pmh.
Don't think I'll be able to pull together a PR. Made a quick attempt of setting explicitCharkey
though, but then everything stopped working :D Or well, I got zero results. Guess some more ._
s have to be sprinkled around the code first for it to work.
from oai-pmh.
I tried to test it here but unfortunately the URL in your original post leads to a 403 HTTP error with the following message:
Unauthorized access to the OAI services – please contact the system administrator for assistance
from oai-pmh.
This one should work I think:
oai-pmh list-records -p marc21 -s oai_komplett http://bibsys-network.alma.exlibrisgroup.com/view/oai/47BIBSYS_NETWORK/request
from oai-pmh.
Related Issues (11)
- trimming of XML responses
- Due to security enforcing measurements, some data providers require that a userAgent is provided on the request
- Error: OAI-PMH provider returned an error: ListRecords verb must receive the metadataPrefix parameter HOT 4
- Error runinng sample code. HOT 1
- GetRecord async error HOT 1
- multiple set use
- TypeError: initialResult[field] is not iterable - when only 1 item is returned from site.
- Compiling error
- How to use? HOT 3
- Library example provided on the README.md does not work straight out of the gate HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oai-pmh.