Skip to content

Instantly share code, notes, and snippets.

@apbarrero
Created October 6, 2011 21:22
Show Gist options
  • Select an option

  • Save apbarrero/1268715 to your computer and use it in GitHub Desktop.

Select an option

Save apbarrero/1268715 to your computer and use it in GitHub Desktop.
Second XSLT using the Muenchian method (I)
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="ticket" select="__none__" />
<xsl:output encoding="utf-8" method="xml" indent="yes" />
<xsl:template match="log">
<xsl:copy>
<xsl:element name="ticket">
<xsl:value-of select="$ticket" />
</xsl:element>
<xsl:apply-templates select="logentry[msg[contains(text(), $ticket)]]" />
</xsl:copy>
</xsl:template>
<xsl:template match="logentry">
<xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment