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

JATS Reader: handle space-separated rid attribute #5310

Closed
hubgit opened this issue Feb 15, 2019 · 0 comments
Closed

JATS Reader: handle space-separated rid attribute #5310

hubgit opened this issue Feb 15, 2019 · 0 comments

Comments

@hubgit
Copy link

hubgit commented Feb 15, 2019

When parsing an xref element with ref-type equal to bibr (i.e. an inline citation), the value of the rid attribute should be treated as a space-separated list of ids.

This is to allow citation of multiple references at the same location, equivalent to the syntax [@ref1; @ref2; @ref3; @ref4; @ref5] in Markdown, e.g. <xref ref-type="bibr" rid="ref1 ref2 ref3 ref4 ref5"/>.

"xref" -> do
ils <- innerInlines
let rid = attrValue "rid" e
let refType = ("ref-type",) <$> maybeAttrValue "ref-type" e
let attr = (attrValue "id" e, [], maybeToList refType)
return $ if refType == Just ("ref-type","bibr")
then cite [Citation{
citationId = rid
, citationPrefix = []
, citationSuffix = []
, citationMode = NormalCitation
, citationNoteNum = 0
, citationHash = 0}] ils

According to the JATS documentation, the rid attribute contains one or more identifiers on any of the following elements:

<aff>, <author-notes>, <award-group>, <award-id>, <bio>, <contrib>, <def>, <funding-source>, <funding-statement>, <named-content>, <sig>, <sig-block>, <term>, <xref>

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

1 participant