Created
September 30, 2014 10:03
-
-
Save labra/723f8240d98de239c9ee to your computer and use it in GitHub Desktop.
QuizSimple xslt
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 version="1.0" | |
| xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
| <xsl:template match="/"> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"/> | |
| </head> | |
| <body> | |
| <h1>Preguntas</h1> | |
| <xsl:apply-templates /> | |
| <p>Número de preguntas=<xsl:value-of select="count(//question)" /></p> | |
| </body> | |
| </html> | |
| </xsl:template> | |
| <xsl:template match="question"> | |
| <div class="question"> | |
| <xsl:apply-templates select="questiontext" /> | |
| <ul> | |
| <xsl:apply-templates select="answer"/> | |
| </ul> | |
| </div> | |
| </xsl:template> | |
| <xsl:template match="questiontext"> | |
| <xsl:value-of select="text" disable-output-escaping="yes" /> | |
| </xsl:template> | |
| <xsl:template match="answer"> | |
| <li><xsl:value-of select="text" disable-output-escaping="yes" /></li> | |
| </xsl:template> | |
| </xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment