X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/215503e15ca9d6d1e8a053f7bfa359af1af102f3..88cabfe:/librarian/xslt/normalize.xslt?ds=inline diff --git a/librarian/xslt/normalize.xslt b/librarian/xslt/normalize.xslt old mode 100755 new mode 100644 index ce0242b..494d028 --- a/librarian/xslt/normalize.xslt +++ b/librarian/xslt/normalize.xslt @@ -1,33 +1,17 @@ <?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://nowoczesnapolska.org.pl/ML/Lektury/1.1" - + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wlf="http://wolnelektury.pl/functions" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" exclude-result-prefixes="wlf xsl" @@ -35,7 +19,7 @@ <!-- Normalization Stylsheet for Wolne Lektury XML --> <xsl:output method="xml" encoding="utf-8" indent="yes" /> - + <xsl:strip-space elements="rdf:RDF rdf:Description meta doc main-text strofa stanza drama-line wlml:*" /> <xsl:param name="normalize-text" select="boolean(1)" /> @@ -54,10 +38,10 @@ </main-text> <annotations> - <xsl:apply-templates select="//pr|pt|pe|pa" mode="annotations" /> + <xsl:apply-templates select="//pr|pt|pe|pa" mode="annotations" /> </annotations> </doc> - </xsl:template> + </xsl:template> <xsl:template match="strofa"> <xsl:element name="stanza" namespace="http://nowoczesnapolska.org.pl/ML/Lektury/1.1"> @@ -127,7 +111,7 @@ <xsl:template match="akap_dialog"> <xsl:element name="pd"> - <xsl:variable name="prolog" select="./text()[1]" /> + <xsl:variable name="prolog" select="./text()[1]" /> <xsl:value-of select="wlf:fix-dialog-line($prolog)" /> <xsl:apply-templates select="@*|*|text()[. != $prolog]" /> </xsl:element> @@ -162,7 +146,7 @@ <xsl:when test="starts-with(., '.')"> <xsl:attribute name="type">dot</xsl:attribute> </xsl:when> - </xsl:choose> + </xsl:choose> </xsl:element> </xsl:template> @@ -260,7 +244,7 @@ <xsl:template match="motto"> <xsl:element name="motto"> <xsl:apply-templates select="@*|node()" /> - + <xsl:variable name="sign" select="following-sibling::*[1][name() = 'motto_podpis']" /> <signature> <xsl:apply-templates select="$sign/node()" /> @@ -269,7 +253,7 @@ </xsl:template> <xsl:template match="motto_podpis[preceding-sibling::*[1][name() = 'motto']]" /> - + <xsl:template match="lista_osob"> <person-list> <xsl:apply-templates select="@*|node()" /> @@ -292,7 +276,7 @@ <xsl:template match="sekcja_swiatlo"> <vertical-space /> </xsl:template> - + <xsl:template match="sekcja_asterysk"> <vertical-space type="asterisk" /> </xsl:template> @@ -325,7 +309,7 @@ </xsl:template> <xsl:template match="naglowek_osoba[following-sibling::*[1][name() = 'kwestia']]" /> - + <!-- Inne --> <xsl:template match="osoba"> <xsl:element name="person-ref"> @@ -373,7 +357,7 @@ <!-- Copy attributes --> <xsl:template match="@*|comment()"> <xsl:copy /> - </xsl:template> + </xsl:template> <!-- Inside RDF meta-data, leave the text unchanged --> <xsl:template match="rdf:RDF//text()"> @@ -394,7 +378,7 @@ <!-- Ignoruj RDF poza meta --> <xsl:template match="rdf:*|dc:*" /> - + <xsl:template match="@*|node()" mode="meta"> <xsl:copy> <xsl:apply-templates match="@*|node()" mode="meta" /> @@ -405,11 +389,11 @@ <xsl:template match="node()"> <xsl:message> <xsl:text>Nieprzetworzony wÄzeÅ:</xsl:text> - <xsl:value-of select="." /> + <xsl:value-of select="." /> </xsl:message> <unparsed-node> <xsl:copy-of select="." /> </unparsed-node> </xsl:template> - + </xsl:stylesheet> \ No newline at end of file