šablona/makra/šifra.xsl
author František Kučera <franta-hg@frantovo.cz>
Sat, 14 Jan 2012 22:52:24 +0100
changeset 88 e856711b66e9
parent 84 f866267d7b3c
permissions -rw-r--r--
ROT13 – šifrování #18: lepší titulek.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
84
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?>
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
<!--
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
XML Web generátor – program na generování webových stránek
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
Copyright © 2012 František Kučera (frantovo.cz)
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
This program is free software: you can redistribute it and/or modify
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
it under the terms of the GNU General Public License as published by
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
the Free Software Foundation, either version 3 of the License, or
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
(at your option) any later version.
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
This program is distributed in the hope that it will be useful,
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
but WITHOUT ANY WARRANTY; without even the implied warranty of
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
GNU General Public License for more details.
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
You should have received a copy of the GNU General Public License
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
along with this program.  If not, see <http://www.gnu.org/licenses/>.
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
-->
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
<xsl:stylesheet version="2.0"
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
	xmlns="http://www.w3.org/1999/xhtml"
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
	xmlns:m="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/makro"
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    24
	exclude-result-prefixes="m xs">
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    26
	<!--
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    27
		Šifrování (Rot13)
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    28
		*****************
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    29
		Umožňuje vkládat „zašifrované“ části textu.
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
		Použijeme např. pro text, který vyzrazuje, jak skončí film.
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    31
		Pro zobrazení v čitelném tvaru je potřeba kliknout na tlačítko a text „dešifrovat“,
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    32
		takže si ho nepřečteme omylem, aniž bychom chtěli.
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    33
		*
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    34
		@algoritmus zatím je výchozím a jediným algoritmem Rot13
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    35
	-->
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    36
	<xsl:template match="m:šifra">
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    37
		<xsl:variable name="šifra-id">šifra-<xsl:number level="any"/></xsl:variable>
88
e856711b66e9 ROT13 – šifrování #18: lepší titulek.
František Kučera <franta-hg@frantovo.cz>
parents: 84
diff changeset
    38
		<span class="rot13" title="Tento text je „zašifrován“ algoritmem Rot13, abyste si ho omylem nepřečetli. Pokud číst chcete, klikněte na tlačítko ↹.">
84
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    39
			<span id="{$šifra-id}"><xsl:value-of select="m:rot13(text())"/></span>
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    40
			<a onclick="javascipt:xwg.rot13('{$šifra-id}'); return false;" href="#{encode-for-uri(' &gt;&gt; zobrazí „zašifrovaný“ text &lt;&lt;')}">↹</a>
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    41
		</span>
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    42
	</xsl:template>
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    43
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    44
	<xsl:function name="m:rot13" as="xs:string">
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    45
		<xsl:param name="vstup"/>
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    46
		<xsl:value-of select="translate($vstup, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 'nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM')"/>
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    47
	</xsl:function>
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    48
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    49
</xsl:stylesheet>
f866267d7b3c ROT13 – šifrování #18
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    50