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: Cite Groups #897

Open
rgieseke opened this issue Apr 7, 2021 · 1 comment
Open

JATS: Cite Groups #897

rgieseke opened this issue Apr 7, 2021 · 1 comment

Comments

@rgieseke
Copy link
Contributor

rgieseke commented Apr 7, 2021

When decoding the following JATS example with a citation like literature [1, 2, 3] shows

<?xml version="1.0"?>
<article>
<front>
<article-meta>
<contrib-group />
</article-meta>
</front>
<body>
<p id="p1">Now The literature [<xref ref-type="bibr" rid="bib-bib1">1</xref>, <xref ref-type="bibr" rid="bib-bib2">2</xref>, <xref ref-type="bibr" rid="bib-bib3">3</xref>] shows it clearly.</p>
</body>
<back>
<ref-list>
<title>References</title>
<ref id="bib.bib1">
<mixed-citation>A. Book</mixed-citation>
</ref>
<ref id="bib.bib2">
<mixed-citation>C. Article</mixed-citation>
</ref>
<ref id="bib.bib3">
<mixed-citation>D. Manuscript</mixed-citation>
</ref>
</ref-list>
<app-group />
</back>
</article>

i get the following JSON (shortened to only show paragraph content):

 "Now The literature ",
        {
          "type": "CiteGroup",
          "items": [
            {
              "type": "Cite",
              "target": "bib-bib1",
              "content": [
                "1"
              ]
            },
            {
              "type": "Cite",
              "target": "bib-bib2",
              "content": [
                "2"
              ]
            },
            {
              "type": "Cite",
              "target": "bib-bib3",
              "content": [
                "3"
              ]
            }
          ]
        },

This is not coming from the JATS decoder which doesn't have a decodeCitegroup function.
As the square brackets vanish too, i wonder if this is happening in the final conversion somehow?
Is this a bug or to be expected?

@rgieseke
Copy link
Contributor Author

In general it seems whitespace makes a difference:

<?xml version="1.0"?>
<article>
<front>
<article-meta>
<contrib-group />
</article-meta>
</front>
<body>
<p id="p1">This has been shown by [<xref ref-type="bibr" rid="bib-bib1">1</xref>].</p>
<p id="p2">This has been shown by [
<xref ref-type="bibr" rid="bib-bib2">1</xref>
].</p>
</body>
<back>
<ref-list>
<title>References</title>
<ref id="bib.bib1">
<mixed-citation>
A. Foo, A Title, 2021</mixed-citation>
</ref>
<ref id="bib.bib2">
<mixed-citation>
B. Bar, Another Title, 2021</mixed-citation>
</ref>
</ref-list>
</back>
</article>

JSON content:

 "content": [
    {
      "type": "Paragraph",
      "id": "p1",
      "content": [
        "This has been shown by ",
        {
          "type": "Cite",
          "target": "bib-bib1",
          "content": [
            1
          ]
        },
        "."
      ]
    },
    {
      "type": "Paragraph",
      "id": "p2",
      "content": [
        "This has been shown by [\n",
        {
          "type": "Cite",
          "target": "bib-bib2",
          "content": [
            1
          ]
        },
        "\n]."
      ]
    }
  ]

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