Created
November 18, 2011 05:23
-
-
Save bauhouse/1375671 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<data> | |
<hello> | |
<entry id="2"> | |
<phrase>Hello</phrase> | |
<name>World</name> | |
</entry> | |
</hello> | |
</data> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> | |
<xsl:import href="utility.xsl" /> | |
</xsl:stylesheet> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> | |
<xsl:output method="xml" | |
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" | |
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" | |
omit-xml-declaration="yes" | |
encoding="UTF-8" | |
indent="yes" /> | |
<xsl:template match="/"> | |
<html> | |
<head> | |
<xsl:apply-templates select="data/hello/entry" mode="head" /> | |
</head> | |
<body> | |
<xsl:apply-templates select="data/hello/entry" mode="body" /> | |
</body> | |
</html> | |
</xsl:template> | |
<xsl:template match="data/hello/entry" mode="head"> | |
<title><xsl:call-template name="salutation" /></title> | |
</xsl:template> | |
<xsl:template match="data/hello/entry" mode="body"> | |
<h1><xsl:call-template name="salutation" /></h1> | |
</xsl:template> | |
<xsl:template name="salutation"> | |
<xsl:value-of select="phrase" /> | |
<xsl:text>, </xsl:text> | |
<xsl:value-of select="name" />! | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment