Skip to content

Preserve Links and Text related to Public Dataset #53

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

Merged
merged 6 commits into from
Sep 19, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/pubget/_data/stylesheets/text_extraction.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,23 @@
</abstract>
<body>
<xsl:apply-templates select="/article/body" />
<xsl:apply-templates select="/article/back//*[self::notes[@notes-type='data-availability'] or self::sec[@sec-type='data-availability']]"/>
</body>
</extracted-text>
</xsl:template>

<xsl:template match="/article/back//*[self::notes or self::sec][(self::notes and @notes-type='data-availability') or (self::sec and @sec-type='data-availability')]">
<xsl:variable name="title" select=".//title"/>
<xsl:if test="$title">
<xsl:value-of select="concat('#', normalize-space($title))"/>
<xsl:text>&#10;</xsl:text>
</xsl:if>
<xsl:for-each select=".//p | .//ext-link[@ext-link-type='uri']">
<xsl:value-of select="normalize-space(.)"/>
<xsl:text> </xsl:text>
</xsl:for-each>
</xsl:template>

<xsl:template match="*" >
<xsl:text> </xsl:text>
<xsl:apply-templates />
Expand Down Expand Up @@ -151,7 +164,7 @@
<xsl:template match="equation-count" />
<xsl:template match="era" />
<xsl:template match="etal" />
<xsl:template match="ext-link" />
<!-- <xsl:template match="ext-link" /> -->
<xsl:template match="fax" />
<xsl:template match="fig-count" />
<xsl:template match="fn" />
Expand Down
Loading