Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Document : zachytka-to-web.xsl
- Created on : 2. dubna 2015, 11:07
- Author : xprazak3
- Description:
- Purpose of transformation follows.
- -->
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
- <xsl:output method="html"
- encoding="UTF-8"
- indent="yes"
- />
- <!-- TODO customize transformation rules
- syntax recommendation http://www.w3.org/TR/xslt
- -->
- <xsl:template match="zachytka">
- <html>
- <head>
- <title>zachytka-to-web.xsl</title>
- </head>
- <body>
- <h1>adresa zachytky</h1>
- <xsl:apply-templates select="adresa"/>
- <h2>rozcestnik</h2>
- <xsl:call-template name="rozcestnik"/>
- <h2>Seznam ulicniku</h2>
- <xsl:apply-templates select="//ulicnik"/>
- </body>
- </html>
- </xsl:template>
- <xsl:template match="adresa">
- <ul>
- <li>
- <xsl:value-of select="ulice"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="cislo popisne"/>
- </li>
- <li><xsl:value-of select="psc"/></li>
- <li><xsl:value-of select="mesto"/></li>
- </ul>
- </xsl:template>
- <xsl:template match="ulicnk">
- <div>
- <h3>
- <xsl:value-of select="jmeno"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="prijmeni"/>
- </h3>
- </div>
- </xsl:template>
- <xsl:template name="rozcestnik">
- <ul>
- <xsl:for-each select="//ulicnik">
- <li>
- <a href="http://www.bla.cz/{@id}">
- <xsl:value-of select="jmeno"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="prijmeni"/>
- </a>
- </li>
- </xsl:for-each>
- </ul>
- </xsl:template>
- </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement