Skip to content

Instantly share code, notes, and snippets.

@ChrisMoney
Last active October 26, 2016 19:14
Show Gist options
  • Save ChrisMoney/385a865464f4c453dbaa7f949f23044b to your computer and use it in GitHub Desktop.
Save ChrisMoney/385a865464f4c453dbaa7f949f23044b to your computer and use it in GitHub Desktop.
XSLT (eXtensible Stylesheet Language Transformations) styles XML
<?xml version="1.0" encoding="UTF-8"?>
<html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<body style="font-family:Arial;font-size:12pt;background-color:#EEEEEE">
<xsl:for-each select="breakfast_menu/food">
<div style="background-color:teal;color:white;padding:4px">
<span style="font-weight:bold"><xsl:value-of select="name"/> - </span>
<xsl:value-of select="price"/>
</div>
<div style="margin-left:20px;margin-bottom:1em;font-size:10pt">
<p>
<xsl:value-of select="description"/>
<span style="font-style:italic"> (<xsl:value-of select="calories"/> calories per serving)</span>
</p>
</div>
</xsl:for-each>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment