Created
December 6, 2011 18:40
-
-
Save bauhouse/1439352 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="1" type="statement"> | |
<phrase>Hello</phrase> | |
<name>World</name> | |
</entry> | |
<entry id="2" type="question"> | |
<phrase>How are you</phrase> | |
</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> | |
<p>Entry ID <xsl:value-of select="@id" /></p> | |
</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