Skip to content

Instantly share code, notes, and snippets.

Created November 1, 2012 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/3993966 to your computer and use it in GitHub Desktop.
Save anonymous/3993966 to your computer and use it in GitHub Desktop.
<data>
<entry id="1">
<name>Woop woop</name>
</entry>
<entry id="2">
<name>Woop woop2</name>
</entry>
<entry id="3">
<name>Woop woop3</name>
</entry>
<entry id="4">
<name>Woop woop4</name>
</entry>
</data>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes" />
<xsl:variable name="currentid" select="'2'"/>
<xsl:template match="/">
<h1>
<xsl:value-of select="data/hello" />
</h1>
<xsl:apply-templates select="entry[not(id() = $currentid)]"/>
</xsl:template>
<xsl:template match="entry">
<p><xsl:text>Poop!</xsl:text> <xsl:value-of select="name"/> </p>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment