Skip to content

Instantly share code, notes, and snippets.

@klaftertief
Created September 30, 2011 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save klaftertief/1253900 to your computer and use it in GitHub Desktop.
Save klaftertief/1253900 to your computer and use it in GitHub Desktop.
My test snippet
<ssstudent_list>
<student>
<name>George Washington</name>
<major>Politics</major>
<phone>312-123-4567</phone>
<email>gw@example.edu</email>
</student>
<student>
<name>Janet Jones</name>
<major>Undeclared</major>
<phone>311-122-2233</phone>
<email>janetj@example.edu</email>
</student>
<student>
<name>Joe Taylor</name>
<major>Engineering</major>
<phone>211-111-2333</phone>
<email>joe@example.edu</email>
</student>
</student_list>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="student_list">
Student Directory for example.edu
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="name">
Name:
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="major">
Major:
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="phone">
Phone:
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="email">
Email:
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment