-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add xsl to introduce label into content surfaced for supp files * Add docs * update kitchen sink fixture to include various iterations of supplementary files * correct filename/heading in docs * update text cases * typos in docs
- Loading branch information
1 parent
f0d638c
commit e9e1190
Showing
25 changed files
with
1,522 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<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()|comment()|processing-instruction()"> | ||
<xsl:copy> | ||
<xsl:apply-templates select="*|@*|text()|comment()|processing-instruction()"/> | ||
</xsl:copy> | ||
</xsl:template> | ||
|
||
<!-- Introduce a caption so that we can surface the label --> | ||
<xsl:template match="supplementary-material[label and not(caption[title or p])]"> | ||
<xsl:copy> | ||
<xsl:apply-templates select="@*|label|label/preceding-sibling::text()"/> | ||
<xsl:text>
</xsl:text> | ||
<xsl:element name="caption"> | ||
<xsl:element name="title"> | ||
<xsl:element name="bold"> | ||
<xsl:apply-templates select="./label[1]/(*|text())"/> | ||
</xsl:element> | ||
</xsl:element> | ||
</xsl:element> | ||
<xsl:apply-templates select="*[name()!='label']|text()|comment()|processing-instruction()"/> | ||
</xsl:copy> | ||
</xsl:template> | ||
|
||
<!-- Introduce the label into the existing caption --> | ||
<xsl:template match="supplementary-material[label and caption[title or p]]"> | ||
<xsl:copy> | ||
<xsl:apply-templates select="@*|label|label/preceding-sibling::text()"/> | ||
<xsl:text>
</xsl:text> | ||
<xsl:element name="caption"> | ||
<xsl:element name="title"> | ||
<xsl:element name="bold"> | ||
<xsl:apply-templates select="./label[1]/(*|text())"/> | ||
<!-- If it doesn't end with punctuation then add some, otherwise just a space --> | ||
<xsl:choose> | ||
<xsl:when test="not(matches([label[1]],'\p{P}$'))"> | ||
<xsl:text>. </xsl:text> | ||
</xsl:when> | ||
<xsl:otherwise> | ||
<xsl:text> </xsl:text> | ||
</xsl:otherwise> | ||
</xsl:choose> | ||
</xsl:element> | ||
<xsl:apply-templates select="caption/title/(*|text())"/> | ||
</xsl:element> | ||
<xsl:apply-templates select="caption/p|caption/title/following-sibling::text()"/> | ||
</xsl:element> | ||
<xsl:apply-templates select="*[not(name()=('label','caption'))]|caption/following-sibling::text()|comment()|processing-instruction()"/> | ||
</xsl:copy> | ||
</xsl:template> | ||
|
||
|
||
</xsl:stylesheet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.