X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/215503e15ca9d6d1e8a053f7bfa359af1af102f3..45ce20d1189ea2042a097bfd9ab7b4b6e96be324:/librarian/xslt/wl2html_base.xslt diff --git a/librarian/xslt/wl2html_base.xslt b/librarian/xslt/wl2html_base.xslt old mode 100755 new mode 100644 index 2b9370c..3341658 --- a/librarian/xslt/wl2html_base.xslt +++ b/librarian/xslt/wl2html_base.xslt @@ -1,31 +1,15 @@ <?xml version="1.0" encoding="utf-8"?> <!-- -# -# This file is part of Librarian. -# -# Copyright © 2008,2009,2010 Fundacja Nowoczesna Polska <fundacja@nowoczesnapolska.org.pl> -# -# For full list of contributors see AUTHORS file. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# + + This file is part of Librarian, licensed under GNU Affero GPLv3 or later. + Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. + --> <xsl:stylesheet version="1.0" - + xmlns="http://www.w3.org/1999/xhtml" - xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wl="http://wolnelektury.pl/functions" exclude-result-prefixes="wl" > @@ -37,7 +21,7 @@ indent="yes" omit-xml-declaration = "yes" /> - <!-- + <!-- Dokument ten opisuje podstawowe przeksztaÅcenia potrzebne do zamiany dokumentu WLML 1.0 na poprawnie sformatowany dokument XHMTL. @@ -68,7 +52,7 @@ <xsl:param name="element" /> <xsl:param name="mypath" /> <xsl:param name="mixed" /> - + <xsl:for-each select="child::node()"> <xsl:apply-templates select="." mode="element-tag"> <xsl:with-param name="offset" select="count(preceding-sibling::*)" /> @@ -77,7 +61,7 @@ </xsl:apply-templates> </xsl:for-each> </xsl:template> - + <xsl:template name="generic-content"> <xsl:param name="element" /> <xsl:param name="mypath" /> @@ -94,7 +78,7 @@ <xsl:with-param name="mixed" select="$mixed" /> </xsl:call-template> </xsl:template> - + <!-- Generyczne szablony --> <xsl:template name="generic" > <xsl:param name="element" /> @@ -105,12 +89,12 @@ <xsl:variable name="tag" select="name($element)" /> <xsl:variable name="group" select="$config//types/*[@element and child::*[local-name() = $tag]]" /> - + <xsl:choose> <!-- ignore namespaced elements --> <xsl:when test="namespace-uri()" /> <xsl:when test="$group/@element"> - + <xsl:element name="{$group/@element}" namespace="http://www.w3.org/1999/xhtml"> <xsl:apply-templates select="$element" mode="element-content" > <xsl:with-param name="mypath" select="$mypath" /> @@ -129,7 +113,7 @@ <xsl:template match="pr|pa|pe|pt" mode="element-tag"> <a href="#annotation-{generate-id(.)}"><span class="annotation"/></a><a name="anchor-{generate-id(.)}" /> - </xsl:template> + </xsl:template> <xsl:template match="dlugi_cytat|poezja_cyt" mode="element-tag"> <xsl:param name="offset" /> @@ -244,7 +228,7 @@ <xsl:variable name="mypath" select="concat($parent-path, '/', name(), '[',string($offset),']')" /> - + <xsl:call-template name="generic-descent"> <xsl:with-param name="element" select="current()" /> <xsl:with-param name="mypath" select="$mypath" /> @@ -342,12 +326,12 @@ <xsl:with-param name="mixed" select="$mixed"/> </xsl:call-template> </xsl:template> - + <xsl:template match="text()" mode="element-tag"> <xsl:param name="mixed" /> <xsl:choose> - + <xsl:when test="not($mixed)"> <xsl:choose> <xsl:when test="not(normalize-space(.))" /> @@ -361,7 +345,7 @@ </xsl:otherwise> </xsl:choose> </xsl:when> - + <xsl:otherwise> <xsl:value-of select="wl:substitute_entities(.)"> <xsl:fallback> @@ -371,9 +355,9 @@ </xsl:otherwise> </xsl:choose> - + </xsl:template> <xsl:template match="node()" /> - + </xsl:stylesheet>