šablona/stránka.xsl
changeset 17 02bad17b4590
parent 16 addd255c39c9
child 18 45e41566f8a6
equal deleted inserted replaced
16:addd255c39c9 17:02bad17b4590
     1 <?xml version="1.0" encoding="UTF-8"?>
     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <xsl:stylesheet version="2.0"
     2 <xsl:stylesheet version="2.0"
     3 	xmlns="http://www.w3.org/1999/xhtml"
     3 	xmlns="http://www.w3.org/1999/xhtml"
     4 	xmlns:h="http://www.w3.org/1999/xhtml"
     4 	xmlns:h="http://www.w3.org/1999/xhtml"
     5 	xmlns:g="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/prostor"
     5 	xmlns:g="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/prostor"
       
     6 	xmlns:m="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/makro"
     6 	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     7 	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     7 	xmlns:fn="http://www.w3.org/2005/xpath-functions"
     8 	xmlns:fn="http://www.w3.org/2005/xpath-functions"
     8 	xmlns:svg="http://www.w3.org/2000/svg"
     9 	xmlns:svg="http://www.w3.org/2000/svg"
     9 	xmlns:xs="http://www.w3.org/2001/XMLSchema"
    10 	xmlns:xs="http://www.w3.org/2001/XMLSchema"
    10 	exclude-result-prefixes="fn h g xs">
    11 	exclude-result-prefixes="fn h g xs m">
    11 	<xsl:output 
    12 	<xsl:output 
    12 		method="xml" 
    13 		method="xml" 
    13 		indent="yes" 
    14 		indent="yes" 
    14 		encoding="UTF-8"		
    15 		encoding="UTF-8"		
    15 		doctype-public="-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" 
    16 		doctype-public="-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" 
    90     	</script>
    91     	</script>
    91     </xsl:template>
    92     </xsl:template>
    92     <xsl:template match="g:web/g:css">
    93     <xsl:template match="g:web/g:css">
    93     	<link href="{text()}" type="text/css" rel="StyleSheet" />
    94     	<link href="{text()}" type="text/css" rel="StyleSheet" />
    94     </xsl:template>
    95     </xsl:template>
       
    96    
       
    97     <!--
       
    98     	Makro pro převod interních odkazů:
       
    99     		- doplnění správné přípony
       
   100     		- URL kódování znaků
       
   101     -->
       
   102     <xsl:template match="m:a">
       
   103     	<a>
       
   104     		<xsl:copy-of select="@*"/>
       
   105     		<xsl:attribute name="href">
       
   106     			<xsl:value-of select="fn:encode-for-uri(concat(@href, $výstupníPřípona))"/>
       
   107     		</xsl:attribute>
       
   108     		<xsl:apply-templates/>
       
   109     	</a>
       
   110     </xsl:template>
    95     
   111     
    96     <!-- Ukázka vlastního „makra“: -->
   112     <!-- Ukázka vlastního „makra“: -->
    97     <xsl:template match="g:měřák">
   113     <xsl:template match="g:měřák">
    98     	<xsl:variable name="hodnota" select="number(@hodnota)"/>
   114     	<xsl:variable name="hodnota" select="number(@hodnota)"/>
    99     	<xsl:variable name="šířkaGrafu" select="128"/>
   115     	<xsl:variable name="šířkaGrafu" select="128"/>