Skip to content

Instantly share code, notes, and snippets.

Created September 25, 2014 21:01
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/94d2d242fd170c22fc01 to your computer and use it in GitHub Desktop.
Save anonymous/94d2d242fd170c22fc01 to your computer and use it in GitHub Desktop.
<data>
<hello>paste your xml here</hello>
<p>Image.jpg</p>
</data>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes" />
<xsl:template match="/">
<hi>
<xsl:value-of select="data/hello" />
</hi>
<xsl:apply-templates select="p" mode="ninja"/>
</xsl:template>
<xsl:template match="p" mode="ninja">
<xsl:choose>
<xsl:when test="contains(.,'.jpg')">
<img src="{concat('//aurl',.}"/>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment