Skip to content

Instantly share code, notes, and snippets.

@tingley
Created August 28, 2017 19:08
Show Gist options
  • Save tingley/656c14186f9a8804a0a4c40b7290b1cc to your computer and use it in GitHub Desktop.
Save tingley/656c14186f9a8804a0a4c40b7290b1cc to your computer and use it in GitHub Desktop.
Parameterized XSLT to add a <tag> to every note in an exported Evernote .enex file
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" cdata-section-elements="content"/>
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="note">
<xsl:copy>
<xsl:apply-templates />
<tag><xsl:value-of select="$tagName"/></tag>
</xsl:copy>
</xsl:template>
<xsl:template match="* | text()">
<xsl:copy>
<xsl:apply-templates />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment