Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.16 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2.  
  3. <!--
  4.    Document   : zachytka-to-web.xsl
  5.    Created on : 2. dubna 2015, 11:07
  6.    Author     : xprazak3
  7.    Description:
  8.        Purpose of transformation follows.
  9. -->
  10.  
  11. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  12.     <xsl:output method="html"
  13.        encoding="UTF-8"
  14.        indent="yes"
  15.    />
  16.  
  17.     <!-- TODO customize transformation rules
  18.         syntax recommendation http://www.w3.org/TR/xslt
  19.    -->
  20.     <xsl:template match="zachytka">
  21.         <html>
  22.             <head>
  23.                 <title>zachytka-to-web.xsl</title>
  24.             </head>
  25.             <body>
  26.                 <h1>adresa zachytky</h1>
  27.                 <xsl:apply-templates select="adresa"/>
  28.                
  29.                 <h2>rozcestnik</h2>
  30.                 <xsl:call-template name="rozcestnik"/>
  31.                 <h2>Seznam ulicniku</h2>
  32.                 <xsl:apply-templates select="//ulicnik"/>
  33.                
  34.             </body>
  35.         </html>
  36.     </xsl:template>
  37.    
  38.     <xsl:template match="adresa">
  39.         <ul>
  40.             <li>
  41.                 <xsl:value-of select="ulice"/>
  42.                 <xsl:text> </xsl:text>
  43.                 <xsl:value-of select="cislo popisne"/>
  44.             </li>
  45.             <li><xsl:value-of select="psc"/></li>
  46.             <li><xsl:value-of select="mesto"/></li>
  47.         </ul>
  48.     </xsl:template>
  49.  
  50.     <xsl:template match="ulicnk">
  51.         <div>
  52.             <h3>
  53.                 <xsl:value-of select="jmeno"/>
  54.                 <xsl:text> </xsl:text>
  55.                 <xsl:value-of select="prijmeni"/>
  56.             </h3>
  57.         </div>
  58.     </xsl:template>
  59.    
  60.     <xsl:template name="rozcestnik">
  61.         <ul>
  62.             <xsl:for-each select="//ulicnik">
  63.                 <li>
  64.                     <a href="http://www.bla.cz/{@id}">
  65.                         <xsl:value-of select="jmeno"/>
  66.                         <xsl:text> </xsl:text>
  67.                         <xsl:value-of select="prijmeni"/>
  68.                     </a>
  69.                 </li>
  70.             </xsl:for-each>
  71.            
  72.         </ul>
  73.     </xsl:template>
  74.    
  75. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement