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

Make parsing namespace prefix agnostic #25

Open
natlibfi-arlehiko opened this issue Jun 22, 2020 · 1 comment
Open

Make parsing namespace prefix agnostic #25

natlibfi-arlehiko opened this issue Jun 22, 2020 · 1 comment

Comments

@natlibfi-arlehiko
Copy link
Contributor

Currently the implementation supports only namespace prefix zs. Make the parsing understand any prefix.

@cboulanger
Copy link

Some servers (such as https://services.dnb.de/sru/dnb) return XML without the ZS namespace. This breaks the library:

TypeError: Cannot read property 'zs:numberOfRecords' of undefined
    at parsePayload /path/to/node_modules/.pnpm/@[email protected]/node_modules/@natlibfi/sru-client/dist/index.js:170:83)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async processRequest (/path/to/node_modules/.pnpm/@[email protected]/node_modules/@natlibfi/sru-client/dist/index.js:118:15)
    at async iterate (/path/to/node_modules/.pnpm/@[email protected]/node_modules/@natlibfi/sru-client/dist/index.js:93:9)

cboulanger added a commit to cboulanger/sru-client-js that referenced this issue Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants