Skip to content

Commit

Permalink
Fixes (#107)
Browse files Browse the repository at this point in the history
* Fix for 88819

Relates to elifesciences/enhanced-preprints-import#1515

* Fix for 90293

Unblocks elifesciences/enhanced-preprints-import#1534

* Fix for 87238v2

Unblocks elifesciences/enhanced-preprints-import#1616

* Fix for 90333v2

* Minor update to 90333 ref fix
  • Loading branch information
fred-atherden authored Nov 3, 2023
1 parent 0611990 commit bd8b9fd
Show file tree
Hide file tree
Showing 13 changed files with 3,274 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,24 @@ This xsl accounts for a bug in Encoda. In this preprint some text that precedes

The xsl adds an empty `disp-quote` element between the paragraph and display equation in order for the two to be adequately separated in the JSON.

### [/src/2023.04.19.535725/equation-fix.xsl](/src/2023.04.19.535725/equation-fix.xsl)

This xsl accounts for a bug in Encoda. In this preprint some text that precedes a display equation is pulled in as if it is a caption for that equation which it treats as a figure.

The xsl adds an empty `disp-quote` element between the paragraph and display equation in order for the two to be adequately separated in the JSON.

### [/src/2022.12.29.522272/fix-refs.xsl](/src/2022.12.29.522272/fix-refs.xsl)

This xsl fixes a couple of references which are missing key information and as a result rendering poorly on EPP.

### [/src/2023.02.04.527146/fix-author-emails.xsl](/src/2023.02.04.527146/fix-author-emails.xsl)

This xsl is to ensure that the correct email is attributed to the correct author. bioRxiv capture author emails addresses in a `<corresp>` inside the author notes. They do this becuase they intend to show the content as a string, instead of displaying the emails under each author it relates to. We have asked them to change this capture (capturing the email under the respecitve author contrib, as done in this xsl).

### [/src/2023.07.30.551185/fix-ref.xsl](/src/2023.07.30.551185/fix-ref.xsl)

This xsl fixes a reference which is missing key information and as a result rendering poorly on EPP.

# Modify bioRxiv XML in preparation for Encoda

Prerequisites:
Expand Down
24 changes: 24 additions & 0 deletions src/2022.12.29.522272/fix-refs.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xlink="http://www.w3.org/1999/xlink"
exclude-result-prefixes="xs"
version="3.0">

<xsl:output method="xml" encoding="UTF-8"/>

<xsl:template match="*|@*|text()">
<xsl:copy>
<xsl:apply-templates select="*|@*|text()"/>
</xsl:copy>
</xsl:template>

<xsl:template match="article[//article-meta/article-version='1.3']//ref[@id='c61']">
<ref id="c61"><label>61.</label><mixed-citation publication-type="journal"><string-name><given-names>H.</given-names> <surname>Pelicano</surname></string-name>, <string-name><given-names>D. S.</given-names> <surname>Martin</surname></string-name>, <string-name><given-names>R.</given-names> <surname>Xu</surname></string-name>, <string-name><given-names>P.</given-names> <surname>Huang</surname></string-name>, <article-title>Glycolysis inhibition for anticancer treatment</article-title>. <source>Oncogene</source>. <fpage>4633</fpage>&#x2013;<lpage>4646</lpage> (<year>2006</year>).</mixed-citation></ref>
</xsl:template>

<xsl:template match="article[//article-meta/article-version='1.3']//ref[@id='c73']">
<ref id="c73"><label>73.</label><mixed-citation publication-type="journal"><string-name><given-names>A.</given-names> <surname>Walvekar</surname></string-name>, <string-name><given-names>Z.</given-names> <surname>Rashida</surname></string-name>, <string-name><given-names>H.</given-names> <surname>Maddali</surname></string-name>, <string-name><given-names>S.</given-names> <surname>Laxman</surname></string-name>, <article-title>A versatile LC-MS / MS approach for comprehensive, quantitative analysis of central metabolic pathways [version 1; peer review : 2 approved]</article-title>. <source>Wellcome Open Res</source> <fpage>1</fpage>&#x2013;<lpage>15</lpage> (<year>2018</year>).</mixed-citation></ref>
</xsl:template>

</xsl:stylesheet>
45 changes: 45 additions & 0 deletions src/2023.02.04.527146/fix-author-emails.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xlink="http://www.w3.org/1999/xlink"
exclude-result-prefixes="xs"
version="3.0">

<xsl:output method="xml" encoding="UTF-8"/>

<xsl:template match="*|@*|text()">
<xsl:copy>
<xsl:apply-templates select="*|@*|text()"/>
</xsl:copy>
</xsl:template>

<xsl:template match="article[//article-meta/article-version='1.3']//article-meta//contrib[@contrib-type='author']">
<xsl:choose>
<xsl:when test="./name/surname='Hage'">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates select="name|contrib-id"/>
<email>[email protected]</email>
<xsl:apply-templates select="*[not(name()=('name','contrib-id')) and not(@ref-type='corresp')]"/>
</xsl:copy>
</xsl:when>
<xsl:when test="./name/surname='Shadmehr'">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:attribute name="corresp">yes</xsl:attribute>
<xsl:apply-templates select="name|contrib-id"/>
<email>[email protected]</email>
<xsl:apply-templates select="*[not(name()=('name','contrib-id')) and not(@ref-type='corresp')]"/>
</xsl:copy>
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="*|@*|text()"/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="article[//article-meta/article-version='1.3']//article-meta/author-notes/corresp"/>

</xsl:stylesheet>
26 changes: 26 additions & 0 deletions src/2023.04.19.535725/equation-fix.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xlink="http://www.w3.org/1999/xlink"
exclude-result-prefixes="xs"
version="3.0">

<xsl:output method="xml" encoding="UTF-8"/>

<xsl:template match="*|@*|text()">
<xsl:copy>
<xsl:apply-templates select="*|@*|text()"/>
</xsl:copy>
</xsl:template>

<xsl:template match="article[//article-meta/article-version='1.2']//disp-formula[graphic/@xlink:href=('535725v2_ueqn1.gif','535725v2_ueqn2.gif','535725v2_ueqn3.gif')]">
<disp-quote/>
<xsl:text>&#xA;</xsl:text>
<xsl:copy>
<xsl:apply-templates select="*|@*|text()"/>
</xsl:copy>
<xsl:text>&#xA;</xsl:text>
<disp-quote/>
</xsl:template>

</xsl:stylesheet>
20 changes: 20 additions & 0 deletions src/2023.07.30.551185/fix-ref.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xlink="http://www.w3.org/1999/xlink"
exclude-result-prefixes="xs"
version="3.0">

<xsl:output method="xml" encoding="UTF-8"/>

<xsl:template match="*|@*|text()">
<xsl:copy>
<xsl:apply-templates select="*|@*|text()"/>
</xsl:copy>
</xsl:template>

<xsl:template match="article[//article-meta/article-version='1.3']//ref[@id='c1']">
<ref id="c1"><mixed-citation publication-type="journal"><string-name><surname>Abad</surname> <given-names>C</given-names></string-name>, <string-name><surname>Cook</surname> <given-names>MM</given-names></string-name>, <string-name><surname>Cao</surname> <given-names>L</given-names></string-name>, <string-name><surname>Jones</surname> <given-names>JR</given-names></string-name>, <string-name><surname>Rao</surname> <given-names>NR</given-names></string-name>, <string-name><surname>Dukes-Rimsky</surname> <given-names>L</given-names></string-name>, <string-name><surname>Pauly</surname> <given-names>R</given-names></string-name>, <string-name><surname>Skinner</surname> <given-names>C</given-names></string-name>, <string-name><surname>Wang</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Luo</surname> <given-names>F</given-names></string-name> <string-name><surname>et al</surname></string-name> (<year>2018</year>) <article-title>A Rare De Novo RAI1 Gene Mutation Affecting BDNF-Enhancer-Driven Transcription Activity Associated with Autism and Atypical Smith-Magenis Syndrome Presentation</article-title>. <source>Biology (Basel)</source> <elocation-id>7</elocation-id></mixed-citation></ref>
</xsl:template>

</xsl:stylesheet>
Loading

0 comments on commit bd8b9fd

Please sign in to comment.