Skip to content

Instantly share code, notes, and snippets.

@commuterjoy
Created November 17, 2011 14:22
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 commuterjoy/1373246 to your computer and use it in GitHub Desktop.
Save commuterjoy/1373246 to your computer and use it in GitHub Desktop.
xsltproc foo.xsl foo.xml
<ol>
<li>
<a href="http://news.bbc.co.uk/democracylive/hi/northern_ireland/newsid_9583000/9583548.stm?t=86s">00:01:28</a>you find out who the <strong>some term</strong> the US and the</li>
</ol>
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:apply-templates select="//li" />
</xsl:template>
<xsl:template match="a"></xsl:template>
<xsl:template match="text()">
<xsl:value-of select="."/>
</xsl:template>
<!-- optional -->
<xsl:template match="strong">
*<xsl:value-of select="."/>*
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment