šablona/makra/skriptování.xsl
author František Kučera <franta-hg@frantovo.cz>
Sat, 23 Jun 2012 18:00:41 +0200
changeset 94 4b3ba32f613c
child 95 eea9c4713045
permissions -rw-r--r--
Skriptování: první verze

<?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.Skriptování"
	xmlns:s="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/strana"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	exclude-result-prefixes="m j s">

	<!--
		Skriptování
		***********
		Provedeme skript zadaný v těle elementu a jeho výstup vložíme do stránky.
		*
		@jazyk programovací jazyk, např. bash, perl, php
		@src skript uložený v souboru místo v těle elementu
	-->
	<xsl:template match="m:skript">
		<!--
		TODO:
			- ošetření chyb
			- nastavení z web.conf (zákaz nebo ignorace skriptů)
			- podpora vkládání fragmentů XML, ne jen prostého textu
		-->
		<xsl:value-of select="j:interpretuj(text(), @jazyk, document-uri(/), //s:stránka/s:nadpis/text(), //s:stránka/s:perex/text())"/>
	</xsl:template>

</xsl:stylesheet>