Skip to content

Instantly share code, notes, and snippets.

@hbi99
Last active August 29, 2015 14:14
Show Gist options
  • Save hbi99/e714247a0329e29fbbb5 to your computer and use it in GitHub Desktop.
Save hbi99/e714247a0329e29fbbb5 to your computer and use it in GitHub Desktop.
<!-- Defiant template -->
<script type="defiant/xsl-template">
<xsl:template name="books_template">
<xsl:for-each select="//movie">
<xsl:value-of select="title"/><br/>
</xsl:for-each>
</xsl:template>
</script>
<script type="text/javascript">
var data = {
"movie": [
{"title": "The Usual Suspects"},
{"title": "Pulp Fiction"},
{"title": "Independence Day"}
]
},
htm = Defiant.render('books_template', data);
console.log(htm);
// The Usual Suspects<br>
// Pulp Fiction<br>
// Independence Day<br>
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment