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

TEI export produces invalid XML #85

Closed
dstillman opened this issue Feb 25, 2019 · 3 comments
Closed

TEI export produces invalid XML #85

dstillman opened this issue Feb 25, 2019 · 3 comments

Comments

@dstillman
Copy link
Member

dstillman commented Feb 25, 2019

A TEI document uses a dedicated XML namespace but includes an id attribute in the XML namespace. The JSDOM XMLSerializer we're using is exporting the id with an ns1 prefix, which makes it invalid XML. The XMLNS prefix has to be xml, and it doesn't need to be defined, so there should just be an xml:id="…" attribute. It's possible the TEI translator could do something different here, but this works properly in Firefox, so I assume this is a bug in JSDOM XMLSerializer.

Reproduce with npm test -- -g TEI

The parser error is may not assign the xml namespace to another prefix.

Reported here: https://groups.google.com/d/topic/zotero-dev/GGpHfZlO8FM/discussion

@mvolz
Copy link
Contributor

mvolz commented Aug 13, 2019

I'm getting this test failing:

/export
should export to TEI:

  AssertionError: expected 'parsererror' to equal 'listBibl'
  + expected - actual

  -parsererror
  +listBibl
  
  at Context.<anonymous> (test/export_test.js:145:10)
  at process.internalTickCallback (internal/process/next_tick.js:77:7)

Is this the same bug?

@mvolz
Copy link
Contributor

mvolz commented Aug 13, 2019

Ah yes, answered my own question: 7bce4a3

@dstillman
Copy link
Member Author

dstillman commented Aug 15, 2019

Are you running with the latest version and current packages? This was fixed in #86 the same day this ticket was opened back in February.

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

No branches or pull requests

2 participants