Skip to content

Instantly share code, notes, and snippets.

@marijn
Created December 2, 2009 15:13
Show Gist options
  • Save marijn/247266 to your computer and use it in GitHub Desktop.
Save marijn/247266 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="transactions.xsl"?>
<transactions>
<transaction status="payed" id="AB-001">
<sender>
<name>John</name>
<familyName>Doe</familyName>
<dateOfBirth format="YYYYMMDD">19541212</dateOfBirth>
<emailAddress>john@doe.name</emailAddress>
</sender>
<price currency="USD">12000</price>
<message><![CDATA[Payment for services rendered]]></message>
</transaction>
<transaction status="payed" id="BD-458">
<sender>
<name>John</name>
<familyName>Appleseed</familyName>
<dateOfBirth format="YYYYMMDD">19661111</dateOfBirth>
<emailAddress>john.appleseed@mac.com</emailAddress>
</sender>
<price currency="USD">18000</price>
<message><![CDATA[Payment for subscription]]></message>
</transaction>
</transactions>
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<title>Transaction overview</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml;charset=UTF-8" />
<style type="text/css">
body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
h1 { font-size: 15px; }
h2 { font-size: 14px; }
p { font-size: 11px; }
</style>
</head>
<body>
<div id="document">
<h1>Transaction overview</h1>
<ol>
<xsl:for-each select="transactions/transaction">
<li>
<h2><xsl:value-of select="sender/name"/>&#0160;<xsl:value-of select="sender/familyName"/></h2>
<p><xsl:value-of select="message"/></p>
</li>
</xsl:for-each>
</ol>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment