šablona/makra/wiki.xsl
author František Kučera <franta-hg@frantovo.cz>
Sat, 14 Jan 2012 17:56:59 +0100
changeset 86 3136e1ad9a5b
parent 76 c7746d95283d
child 87 25dec6931f18
permissions -rw-r--r--
Pre bude mít overflow: auto; + opravy odsazení v CSS.

<?xml version="1.0" encoding="UTF-8"?>
<!--
XML Web generátor – program na generování webových stránek
Copyright © 2012 František Kučera (frantovo.cz)

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
-->
<xsl:stylesheet version="2.0"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:m="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/makro"
	xmlns:j="java:cz.frantovo.xmlWebGenerator.makra.Wiki"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	exclude-result-prefixes="m j">

	<!--
		Wiki syntaxe
		************
		Text nemusíme vkládat v (X)HTML, ale můžeme ho uzavřít do této značky a používat „wiki“ syntaxi.
		*
		@syntaxe nepovinný atribut (zatím je podporován jen markdown procesor).
	-->
	<xsl:template match="m:wiki">
		<xsl:variable name="wikiXHTML" select="j:formátujWiki(text(), @syntaxe)"/>
		<xsl:choose>
			<xsl:when test="$wikiXHTML">
				<xsl:value-of select="$wikiXHTML" disable-output-escaping="yes"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:message terminate="yes">Při zpracování wiki syntaxe došlo k chybě.</xsl:message>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

</xsl:stylesheet>