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.js > Generate IDs: xml invalid for @xml:id and <imprint/> #1704

Closed
oriflamms opened this Issue Aug 3, 2018 · 8 comments

Comments

Projects
None yet
2 participants
@oriflamms
Contributor

oriflamms commented Aug 3, 2018

In exporting a library into TEI format, I get three different errors:

  1. value of attribute "xml:id" is invalid; must be an XML name without colons
    corresponding to the presence of apostrophes (either " ' " or " ’ ") in author names such as "Gerard O’Daly"
    I would suggest to deal specifically with those two signs into lines 122, 123 (xmlid = xmlid.replace)

  2. element "imprint" incomplete; expected element "biblScope", "catRef", "classCode", "date", "distributor", "pubPlace", "publisher" or "time
    corresponding to the exported
    <imprint><!-- no publisher, publication date or place given --></imprint>
    Obviously an incentive to search for the information, but not always feasible.
    I would suggest to export empty elements
    <pubPlace/><publisher/><date/>

  3. element "note" not allowed yet; expected element "biblScope", "catRef", "classCode", "date", "distributor", "pubPlace", "publisher" or "time"
    in monographs that have no place nor date, but a URL
    The suggested solution for point 2 solves also this one.

@oriflamms oriflamms changed the title from translators > TEI.js > Generate IDs: xml invalid for @xml:id and <imprint/> to TEI.js > Generate IDs: xml invalid for @xml:id and <imprint/> Aug 3, 2018

@adam3smith

This comment has been minimized.

Show comment
Hide comment
@adam3smith

adam3smith Aug 3, 2018

Collaborator

sorry, what tool exactly is throwing those errors?

Collaborator

adam3smith commented Aug 3, 2018

sorry, what tool exactly is throwing those errors?

@oriflamms

This comment has been minimized.

Show comment
Hide comment
@oriflamms

oriflamms Aug 3, 2018

Contributor

Thank you for your answer. My xml editor is Oxygen

Contributor

oriflamms commented Aug 3, 2018

Thank you for your answer. My xml editor is Oxygen

@adam3smith

This comment has been minimized.

Show comment
Hide comment
@adam3smith

adam3smith Aug 4, 2018

Collaborator

that all sounds right. If you'd be willing ot turn this into a pull request, that'd be very helfpul. It'd probably take some time for me to get around to doing this myself.

Collaborator

adam3smith commented Aug 4, 2018

that all sounds right. If you'd be willing ot turn this into a pull request, that'd be very helfpul. It'd probably take some time for me to get around to doing this myself.

@oriflamms

This comment has been minimized.

Show comment
Hide comment
@oriflamms

oriflamms Aug 4, 2018

Contributor

Thanks for your incentive. Done.
However, I could not fix the fact that authors in single mode are not exported. I've tried with
if (item.creators[i].fieldMode == true) { // fieldMode true, assume corporate author surname = teiDoc.createElementNS(ns.tei, "name"); surname.appendChild(teiDoc.createTextNode(item.creators[i].firstName)); curCreator.appendChild(surname); }
and also lastName, but this is not working and I haven't found a solution. Do you want me to open another issue? If you give me a hint, I'll test it and do another pull request.

Contributor

oriflamms commented Aug 4, 2018

Thanks for your incentive. Done.
However, I could not fix the fact that authors in single mode are not exported. I've tried with
if (item.creators[i].fieldMode == true) { // fieldMode true, assume corporate author surname = teiDoc.createElementNS(ns.tei, "name"); surname.appendChild(teiDoc.createTextNode(item.creators[i].firstName)); curCreator.appendChild(surname); }
and also lastName, but this is not working and I haven't found a solution. Do you want me to open another issue? If you give me a hint, I'll test it and do another pull request.

@adam3smith

This comment has been minimized.

Show comment
Hide comment
@adam3smith

adam3smith Aug 4, 2018

Collaborator

Thanks for working on this. I didn't actually know this myself, but items with fieldMode == true are returned by Zotero as { "name": "Singlefield" "creatorType": "author" } (I found this out by putting Z.debug(item.creators[i]) into the loop for the authors), i.e. if (item.creators[i].name) should work.

Collaborator

adam3smith commented Aug 4, 2018

Thanks for working on this. I didn't actually know this myself, but items with fieldMode == true are returned by Zotero as { "name": "Singlefield" "creatorType": "author" } (I found this out by putting Z.debug(item.creators[i]) into the loop for the authors), i.e. if (item.creators[i].name) should work.

@adam3smith

This comment has been minimized.

Show comment
Hide comment
@adam3smith

adam3smith Aug 4, 2018

Collaborator

and feel free to wrap this into the same pull request if you don't mind.

Collaborator

adam3smith commented Aug 4, 2018

and feel free to wrap this into the same pull request if you don't mind.

@oriflamms

This comment has been minimized.

Show comment
Hide comment
@oriflamms

oriflamms Aug 4, 2018

Contributor

Great! Thank you for your help. Works perfectly.

Contributor

oriflamms commented Aug 4, 2018

Great! Thank you for your help. Works perfectly.

@adam3smith

This comment has been minimized.

Show comment
Hide comment
@adam3smith

adam3smith Oct 4, 2018

Collaborator

Closed a while back in #1705

Collaborator

adam3smith commented Oct 4, 2018

Closed a while back in #1705

@adam3smith adam3smith closed this Oct 4, 2018

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