Skip to content

Instantly share code, notes, and snippets.

Last active December 15, 2015 13:39
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tts/5268732 to your computer and use it in GitHub Desktop.
Transform an XML file with a sample of Aalto publications sorted by WoS citation scores to a jQuery Mobile framework HTML5 file with the ImpactStory JavaScript widget.
<?xml version="1.0"?>
Tuija Sonkkila 28.3.2013
Transform an XML file to a jQuery Mobile framework HTML5 file with
the ImpactStory altmetrics JavaScript widget. For the making of the
source XML file, see
java -jar saxon8he.jar -xsl:xml2html5jqmwithalt.xsl -s:pubs.xml -o:alt.html
<xsl:output method="html" indent="yes"/>
<xsl:variable name="baseurl" select="''"/>
<xsl:template match="/">
<title>ImpactStory altmetrics for a sample of Aalto publications</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="" />
<script src=""></script>
<script src=""></script>
<script type="text/javascript" src=""></script>
<body class="home">
<div data-role="page" data-theme="c" id="home">
<div data-role="header">
<h1>Altmetrics by ImpactStory</h1>
</div> <!-- header -->
<div data-role="content">
<!-- Acronyms of Aalto Schools -->
<ul data-role="listview" data-inset="true">
<li><a href="#ARTS">ARTS</a></li>
<li><a href="#BIZ">BIZ</a></li>
<li><a href="#CHEM">CHEM</a></li>
<li><a href="#ELEC">ELEC</a></li>
<li><a href="#ENG">ENG</a></li>
<li><a href="#SCI">SCI</a></li>
</div> <!-- content -->
</div> <!-- page -->
<xsl:for-each-group select="pubs/pub" group-by="school">
<div data-role="page" data-theme="c" id="{current-grouping-key()}">
<div data-role="header">
<h1><xsl:value-of select="current-grouping-key()"/></h1>
<a href="alt.html" data-icon="home" data-iconpos="notext">Home</a>
</div> <!-- header -->
<div data-role="content">
<ul data-role="listview">
<xsl:for-each select="current-group()">
<xsl:variable name="doi" select="doi"/>
<p><xsl:value-of select="year"/></p>
<p><strong><xsl:value-of select="title"/></strong></p>
<p><xsl:value-of select="cites"/><xsl:text> WoS cites</xsl:text></p>
<p><a target="_blank">
<xsl:attribute name="href"><xsl:value-of select="concat($baseurl, $doi)"/></xsl:attribute>
<xsl:value-of select="$doi"/></a>
<p class="ui-li-aside">
<span class="impactstory-embed impactstory-small impactstory-tag impactstory-color"
data-show-logo="false" data-badge-size="small" data-id="{$doi}" data-id-type="doi"
data-api-key="[put your ImpactStory key here"></span>
</div> <!-- content -->
</div> <!-- page -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment