Skip to content

Instantly share code, notes, and snippets.

@shawngraham
Last active October 15, 2020 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shawngraham/fbacabe55bd9888023367452bf30a8a9 to your computer and use it in GitHub Desktop.
Save shawngraham/fbacabe55bd9888023367452bf30a8a9 to your computer and use it in GitHub Desktop.
sample metadata from jstor-dfr, and an xsl file meant to turn it into a citations.tsv with: xsltproc bib.xsl *.xml > citations.tsv
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:for-each select="article/front">
"<xsl:value-of select="article-meta/contrib-group/contrib/string-name/surname" />, <xsl:value-of select="article-meta/contrib-group/contrib/string-name/given-names" />" <xsl:text>&#9;</xsl:text><xsl:value-of select="article-meta/pub-date/year" /> <xsl:text>&#9;</xsl:text> "<xsl:value-of select="article-meta/title-group/article-title" />" <xsl:text>&#9;"</xsl:text><xsl:value-of select="journal-meta/journal-title-group/journal-title"/>"<xsl:text>&#9;</xsl:text> "<xsl:value-of select="article-meta/volume" />(<xsl:value-of select="article-meta/issue" />)" <xsl:text>&#9;</xsl:text> "<xsl:value-of select="article-meta/page-range" />" <xsl:text>&#9;</xsl:text>"<xsl:value-of select="article-meta/article-id" />" <xsl:text>&#9;</xsl:text><xsl:value-of select="article-meta/self-uri" /><xsl:text>&#xA;</xsl:text>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
<article xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:mml="http://www.w3.org/1998/Math/MathML"
dtd-version="1.0"
article-type="research-article">
<front>
<journal-meta>
<journal-id journal-id-type="jstor">englishj</journal-id>
<journal-id journal-id-type="jstor">j100151</journal-id>
<journal-title-group>
<journal-title>The English Journal</journal-title>
</journal-title-group>
<publisher>
<publisher-name>National Council of Teachers of English</publisher-name>
</publisher>
<issn pub-type="ppub">00138274</issn>
</journal-meta>
<article-meta>
<article-id pub-id-type="doi">10.2307/801807</article-id>
<title-group>
<article-title>The Teaching of Versification in the High School</article-title>
</title-group>
<contrib-group>
<contrib contrib-type="author">
<string-name>
<given-names>Eleanora F.</given-names>
<surname>Deem</surname>
</string-name>
</contrib>
</contrib-group>
<pub-date>
<day>1</day>
<month>2</month>
<year>1916</year>
</pub-date>
<volume>5</volume>
<issue>2</issue>
<issue-id>i233049</issue-id>
<fpage>119</fpage>
<lpage>130</lpage>
<page-range>119-130</page-range>
<permissions>
<copyright-statement/>
</permissions>
<self-uri xlink:href="http://www.jstor.org/stable/801807"/>
<custom-meta-group>
<custom-meta>
<meta-name>lang</meta-name>
<meta-value>eng</meta-value>
</custom-meta>
</custom-meta-group>
</article-meta>
</front>
</article>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment