Skip to content

Commit

Permalink
Merge pull request #816 from elifesciences/pr-816
Browse files Browse the repository at this point in the history
RP XSL changes
  • Loading branch information
fred-atherden authored Feb 13, 2025
2 parents 189b38e + 43978f0 commit a57253a
Show file tree
Hide file tree
Showing 19 changed files with 289 additions and 18 deletions.
29 changes: 25 additions & 4 deletions src/preprint-changes.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -756,15 +756,22 @@
</xsl:choose>
<xsl:element name="p">
<xsl:choose>
<xsl:when test="./@notes-type='competing-interest-statement'">
<xsl:text>Competing interests: </xsl:text>
<xsl:choose>
<xsl:when test="count(p) = 1 and ./p[1]='The authors have declared no competing interest.'">
<xsl:text>No competing interests declared</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="./p/(*|text())"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="./title">
<xsl:value-of select="./title"/>
<xsl:text>: </xsl:text>
<xsl:apply-templates select="./p/(*|text())"/>
</xsl:when>
<xsl:when test="./@notes-type='competing-interest-statement'">
<xsl:text>Competing interests: </xsl:text>
<xsl:apply-templates select="./p/(*|text())"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="./p/(*|text())"/>
</xsl:otherwise>
Expand Down Expand Up @@ -1376,6 +1383,20 @@
<xsl:apply-templates select="*|text()|comment()|processing-instruction()"/>
</xsl:copy>
</xsl:template>

<!-- Add sec-type="ethics-statement" -->
<xsl:template xml:id="sec-ethics" match="sec[(not(@sec-type)) and matches(lower-case(title[1]),'ethics') and not(matches(lower-case(title[1]),'data') and matches(lower-case(title[1]),'ava[il][il]ability|access|sharing')) and not(ancestor::sec[matches(lower-case(title[1]),'ethics')])]">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:attribute name="sec-type">ethics-statement</xsl:attribute>
<xsl:if test="not(@id)">
<xsl:attribute name="id">
<xsl:value-of select="generate-id(.)"/>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates select="*|text()|comment()|processing-instruction()"/>
</xsl:copy>
</xsl:template>

<!-- Strip unnecessary bolding and italicisation from inside citations -->
<xsl:template xml:id="strip-bold-italic-around-xref" match="xref/bold[italic[not(xref)]]
Expand Down
6 changes: 5 additions & 1 deletion src/rp-schematron-base.sch
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,7 @@
role="error"
id="sec-empty">sec element is not populated with any content. Either there's a mistake or the section should be removed.</assert>

<report test="@sec-type='data-availability' and preceding::sec[@sec-type='data-availability']"
<report test="@sec-type='data-availability' and (preceding::sec[@sec-type='data-availability'] or ancestor::sec[@sec-type='data-availability'])"
role="warning"
id="sec-data-availability">sec has the sec-type 'data-availability', but there is one or more other secs with this same sec-type. Are they duplicates?</report>

Expand All @@ -1230,6 +1230,10 @@
role="warning"
id="sec-coi-2">sec has a title suggesting it's a competing interest statement. COI statements should be captured within author-notes, so this content should be moved into fn with the fn-type="coi-statement" within author-notes.</report>

<report test="@sec-type='ethics-statement' and (preceding::sec[@sec-type='ethics-statement'] or ancestor::sec[@sec-type='ethics-statement'])"
role="error"
id="sec-ethics">sec has the sec-type 'ethics-statement', but there is one or more other secs with this same sec-type. Are they duplicates? There can only be one section with this sec-type (although it can have subsections with further distinctions that have separate 'ethics-...' sec-types - e.g. "ethics-approval-human", "ethics-approval-animal" etc.)</report>

<report test="def-list and not(*[not(name()=('label','title','sec-meta','def-list'))])"
role="error"
id="sec-def-list">sec element only contains a child def-list. This is therefore a glossary, not a sec.</report>
Expand Down
4 changes: 3 additions & 1 deletion src/rp-schematron.sch
Original file line number Diff line number Diff line change
Expand Up @@ -675,12 +675,14 @@

<assert test="*[not(name()=('label','title','sec-meta'))]" role="error" id="sec-empty">[sec-empty] sec element is not populated with any content. Either there's a mistake or the section should be removed.</assert>

<report test="@sec-type='data-availability' and preceding::sec[@sec-type='data-availability']" role="warning" id="sec-data-availability">[sec-data-availability] sec has the sec-type 'data-availability', but there is one or more other secs with this same sec-type. Are they duplicates?</report>
<report test="@sec-type='data-availability' and (preceding::sec[@sec-type='data-availability'] or ancestor::sec[@sec-type='data-availability'])" role="warning" id="sec-data-availability">[sec-data-availability] sec has the sec-type 'data-availability', but there is one or more other secs with this same sec-type. Are they duplicates?</report>

<report test="title[1][matches(lower-case(.),'(compete?t?ing|conflicts?[\s-]of)[\s-]interest|disclosure|declaration|disclaimer')] and ancestor::article//article-meta/author-notes/fn[@fn-type='coi-statement']" role="warning" id="sec-coi">[sec-coi] sec has a title suggesting it's a competing interest statement, but there is also a competing interest statement in author-notes. Are they duplicates? COI statements should be captured within author-notes, so this section should likely be deleted.</report>

<report test="title[1][matches(lower-case(.),'(compete?t?ing|conflicts?[\s-]of)[\s-]interest|disclosure|declaration|disclaimer')] and not(ancestor::article//article-meta/author-notes/fn[@fn-type='coi-statement'])" role="warning" id="sec-coi-2">[sec-coi-2] sec has a title suggesting it's a competing interest statement. COI statements should be captured within author-notes, so this content should be moved into fn with the fn-type="coi-statement" within author-notes.</report>

<report test="@sec-type='ethics-statement' and (preceding::sec[@sec-type='ethics-statement'] or ancestor::sec[@sec-type='ethics-statement'])" role="error" id="sec-ethics">[sec-ethics] sec has the sec-type 'ethics-statement', but there is one or more other secs with this same sec-type. Are they duplicates? There can only be one section with this sec-type (although it can have subsections with further distinctions that have separate 'ethics-...' sec-types - e.g. "ethics-approval-human", "ethics-approval-animal" etc.)</report>

<report test="def-list and not(*[not(name()=('label','title','sec-meta','def-list'))])" role="error" id="sec-def-list">[sec-def-list] sec element only contains a child def-list. This is therefore a glossary, not a sec.</report>

<report test="glossary and not(*[not(name()=('label','title','sec-meta','glossary'))])" role="warning" id="sec-glossary">[sec-glossary] sec element only contains a child glossary. Is it a redundant sec (which should be deleted)? Or perhaps it indicates the structure/hierarchy has been incorrectly captured.</report>
Expand Down
15 changes: 13 additions & 2 deletions src/rp-schematron.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -5066,8 +5066,8 @@
</xsl:otherwise>
</xsl:choose>
<!--REPORT warning-->
<xsl:if test="@sec-type='data-availability' and preceding::sec[@sec-type='data-availability']">
<svrl:successful-report xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="@sec-type='data-availability' and preceding::sec[@sec-type='data-availability']">
<xsl:if test="@sec-type='data-availability' and (preceding::sec[@sec-type='data-availability'] or ancestor::sec[@sec-type='data-availability'])">
<svrl:successful-report xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="@sec-type='data-availability' and (preceding::sec[@sec-type='data-availability'] or ancestor::sec[@sec-type='data-availability'])">
<xsl:attribute name="id">sec-data-availability</xsl:attribute>
<xsl:attribute name="role">warning</xsl:attribute>
<xsl:attribute name="location">
Expand Down Expand Up @@ -5099,6 +5099,17 @@
</svrl:successful-report>
</xsl:if>
<!--REPORT error-->
<xsl:if test="@sec-type='ethics-statement' and (preceding::sec[@sec-type='ethics-statement'] or ancestor::sec[@sec-type='ethics-statement'])">
<svrl:successful-report xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="@sec-type='ethics-statement' and (preceding::sec[@sec-type='ethics-statement'] or ancestor::sec[@sec-type='ethics-statement'])">
<xsl:attribute name="id">sec-ethics</xsl:attribute>
<xsl:attribute name="role">error</xsl:attribute>
<xsl:attribute name="location">
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
</xsl:attribute>
<svrl:text>[sec-ethics] sec has the sec-type 'ethics-statement', but there is one or more other secs with this same sec-type. Are they duplicates? There can only be one section with this sec-type (although it can have subsections with further distinctions that have separate 'ethics-...' sec-types - e.g. "ethics-approval-human", "ethics-approval-animal" etc.)</svrl:text>
</svrl:successful-report>
</xsl:if>
<!--REPORT error-->
<xsl:if test="def-list and not(*[not(name()=('label','title','sec-meta','def-list'))])">
<svrl:successful-report xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="def-list and not(*[not(name()=('label','title','sec-meta','def-list'))])">
<xsl:attribute name="id">sec-def-list</xsl:attribute>
Expand Down
2 changes: 1 addition & 1 deletion test/tests/preprint-changes/all/output.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<fn id="n2" fn-type="present-address"><label>‡</label><p><bold>Present address</bold>: Department of Biochemistry, University of Zurich, Winterthurerstr. 190, CH-8057 Zurich, Switzerland</p></fn>
<fn id="n3" fn-type="present-address"><label>§</label><p>Present address: Massachusetts <italic>Institute</italic> of <bold>Technology</bold>, Picower Institute for Learning and Memory, 43 Vassar St, Cambridge, MA 02139, United States</p></fn>
<fn id="n4" fn-type="present-address"><label>¶</label><p>Present address: Vertex Pharmaceuticals, 50 Northern Avenue, Boston, Mass. 02210, United States</p></fn>
<fn fn-type="coi-statement"><p>Competing Interest Statement: The authors have declared no competing interest.</p></fn>
<fn fn-type="coi-statement"><p>Competing interests: No competing interests declared</p></fn>
</author-notes>
<permissions>
<ali:free_to_read/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</contrib>
</contrib-group>
<author-notes>
<fn fn-type="coi-statement"><p>Competing Interest Statement: The authors have declared no competing interest.</p></fn>
<fn fn-type="coi-statement"><p>Competing interests: No competing interests declared</p></fn>
</author-notes>
<pub-date pub-type="epub"><year>2024</year></pub-date>
<volume>13</volume>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<front>
<article-meta><author-notes>
<fn/>
<fn fn-type="coi-statement"><p>Competing Interest Statement: The authors have declared no competing interest.</p></fn>
<fn fn-type="coi-statement"><p>Competing interests: No competing interests declared</p></fn>
</author-notes>
<related-object content-type="" source-id="" source-id-type="registry-name" source-type="clinical-trials-registry" document-id="" document-id-type="clinical-trial-number" xlink:href="">DRKS00021419</related-object>
<custom-meta-group>
Expand Down
6 changes: 3 additions & 3 deletions test/tests/preprint-changes/rearrange-back/output.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<title>Something else</title>
<p>...</p>
</ack>
<sec id="d545e19" sec-type="additional-information">
<sec id="d556e19" sec-type="additional-information">
<title>Additional information</title>
<sec id="s5">
<title>Funding</title>
Expand All @@ -41,9 +41,9 @@
<p>All code and software needed to generate the results is available as part of public resources: LD score regression (<ext-link ext-link-type="uri" xlink:href="https://github.com/bulik/ldsc">https://github.com/bulik/ldsc</ext-link>), FUMA (<ext-link ext-link-type="uri" xlink:href="https://fuma.ctglab.nl/">https://fuma.ctglab.nl/</ext-link>), MiXeR (<ext-link ext-link-type="uri" xlink:href="https://github.com/precimed/mixer">https://github.com/precimed/mixer</ext-link>), BM location (simulation, training, and model) <italic>[made public upon acceptance]</italic>.</p>
</sec>
</sec>
<sec id="suppd545e19" sec-type="supplementary-material">
<sec id="suppd556e19" sec-type="supplementary-material">
<title>Additional files</title>
<supplementary-material id="d545e10">
<supplementary-material id="d556e10">
<label>Supplementary materials</label>
<media xlink:href="supplements/278950_file02.docx"/>
</supplementary-material>
Expand Down
13 changes: 13 additions & 0 deletions test/tests/preprint-changes/sec-ethics/input.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!--Testing template with id: sec-ethics-->
<sec id="s4">
<title>ETHICS STATEMENT</title>
<sec>
<title>Human</title>
</sec>
<sec>
<title>Monkey</title>
</sec>
<sec>
<title>Machine</title>
</sec>
</sec>
13 changes: 13 additions & 0 deletions test/tests/preprint-changes/sec-ethics/output.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!--Testing template with id: sec-ethics-->
<sec id="s4" sec-type="ethics-statement">
<title>ETHICS STATEMENT</title>
<sec>
<title>Human</title>
</sec>
<sec>
<title>Monkey</title>
</sec>
<sec>
<title>Machine</title>
</sec>
</sec>
2 changes: 1 addition & 1 deletion test/tests/rp/sec-checks/sec-data-availability/fail.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?oxygen SCHSchema="sec-data-availability.sch"?>
<!--Context: sec
Test: report @sec-type='data-availability' and preceding::sec[@sec-type='data-availability']
Test: report @sec-type='data-availability' and (preceding::sec[@sec-type='data-availability'] or ancestor::sec[@sec-type='data-availability'])
Message: sec has the sec-type 'data-availability', but there is one or more other secs with this same sec-type. Are they duplicates? -->
<root xmlns:ali="http://www.niso.org/schemas/ali/1.0/" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">
<article>
Expand Down
2 changes: 1 addition & 1 deletion test/tests/rp/sec-checks/sec-data-availability/pass.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?oxygen SCHSchema="sec-data-availability.sch"?>
<!--Context: sec
Test: report @sec-type='data-availability' and preceding::sec[@sec-type='data-availability']
Test: report @sec-type='data-availability' and (preceding::sec[@sec-type='data-availability'] or ancestor::sec[@sec-type='data-availability'])
Message: sec has the sec-type 'data-availability', but there is one or more other secs with this same sec-type. Are they duplicates? -->
<root xmlns:ali="http://www.niso.org/schemas/ali/1.0/" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">
<article>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
</xsl:function>
<pattern id="sec-checks-pattern">
<rule context="sec" id="sec-checks">
<report test="@sec-type='data-availability' and preceding::sec[@sec-type='data-availability']" role="warning" id="sec-data-availability">[sec-data-availability] sec has the sec-type 'data-availability', but there is one or more other secs with this same sec-type. Are they duplicates?</report>
<report test="@sec-type='data-availability' and (preceding::sec[@sec-type='data-availability'] or ancestor::sec[@sec-type='data-availability'])" role="warning" id="sec-data-availability">[sec-data-availability] sec has the sec-type 'data-availability', but there is one or more other secs with this same sec-type. Are they duplicates?</report>
</rule>
</pattern>
<pattern id="root-pattern">
Expand Down
17 changes: 17 additions & 0 deletions test/tests/rp/sec-checks/sec-ethics/fail.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?oxygen SCHSchema="sec-ethics.sch"?>
<!--Context: sec
Test: report @sec-type='ethics-statement' and (preceding::sec[@sec-type='ethics-statement'] or ancestor::sec[@sec-type='ethics-statement'])
Message: sec has the sec-type 'ethics-statement', but there is one or more other secs with this same sec-type. Are they duplicates? There can only be one section with this sec-type (although it can have subsections with further distinctions that have separate 'ethics-...' sec-types - e.g. "ethics-approval-human", "ethics-approval-animal" etc.) -->
<root xmlns:ali="http://www.niso.org/schemas/ali/1.0/" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">
<article>
<sec id="s6" sec-type="ethics-statement">
<title>Ethics</title>
<sec sec-type="ethics-statement">
<p>Human subjects: Fresh tissue samples were obtained upon informed consent from patients undergoing surgery at the Gynecology Division of the European Institute of Oncology (Milan). Sample collection was performed under the protocol number R789-IEO approved by the Ethics Committee of the European Institute of Oncology.</p>
</sec>
<sec sec-type="ethics-statement">
<p>Animal experimentation: All animal studies were performed following a protocol approved by the fully authorized animal facility of European Institute of Oncology and by the Italian Ministry of Health (as required by the Italian Law) (IACUCs number 1256/2015) and in accordance to EU directive 2010/63. Mouse tissues were obtained from Karolinska Institutet (Stockholm, Sweden) and IRCCS San Raffaele Scientific Institute (Milan, Italy), in accordance with Institutional Animal Care and Use Committees.</p>
</sec>
</sec>
</article>
</root>
17 changes: 17 additions & 0 deletions test/tests/rp/sec-checks/sec-ethics/pass.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?oxygen SCHSchema="sec-ethics.sch"?>
<!--Context: sec
Test: report @sec-type='ethics-statement' and (preceding::sec[@sec-type='ethics-statement'] or ancestor::sec[@sec-type='ethics-statement'])
Message: sec has the sec-type 'ethics-statement', but there is one or more other secs with this same sec-type. Are they duplicates? There can only be one section with this sec-type (although it can have subsections with further distinctions that have separate 'ethics-...' sec-types - e.g. "ethics-approval-human", "ethics-approval-animal" etc.) -->
<root xmlns:ali="http://www.niso.org/schemas/ali/1.0/" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">
<article>
<sec id="s6" sec-type="ethics-statement">
<title>Ethics</title>
<sec sec-type="ethics-approval-human">
<p>Human subjects: Fresh tissue samples were obtained upon informed consent from patients undergoing surgery at the Gynecology Division of the European Institute of Oncology (Milan). Sample collection was performed under the protocol number R789-IEO approved by the Ethics Committee of the European Institute of Oncology.</p>
</sec>
<sec sec-type="ethics-approval-animal">
<p>Animal experimentation: All animal studies were performed following a protocol approved by the fully authorized animal facility of European Institute of Oncology and by the Italian Ministry of Health (as required by the Italian Law) (IACUCs number 1256/2015) and in accordance to EU directive 2010/63. Mouse tissues were obtained from Karolinska Institutet (Stockholm, Sweden) and IRCCS San Raffaele Scientific Institute (Milan, Italy), in accordance with Institutional Animal Care and Use Committees.</p>
</sec>
</sec>
</article>
</root>
Loading

0 comments on commit a57253a

Please sign in to comment.