fnp
/
librarian.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove cut lines
[librarian.git]
/
librarian
/
xslt
/
normalize.xslt
diff --git
a/librarian/xslt/normalize.xslt
b/librarian/xslt/normalize.xslt
old mode 100755
(executable)
new mode 100644
(file)
index
f5e0314
..
85a2a65
--- a/
librarian/xslt/normalize.xslt
+++ b/
librarian/xslt/normalize.xslt
@@
-1,11
+1,17
@@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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"
<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: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"
xmlns:dc="http://purl.org/dc/elements/1.1/"
exclude-result-prefixes="wlf xsl"
@@
-13,7
+19,7
@@
<!-- Normalization Stylsheet for Wolne Lektury XML -->
<xsl:output method="xml" encoding="utf-8" indent="yes" />
<!-- 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)" />
<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)" />
@@
-32,10
+38,10
@@
</main-text>
<annotations>
</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>
</annotations>
</doc>
- </xsl:template>
+ </xsl:template>
<xsl:template match="strofa">
<xsl:element name="stanza" namespace="http://nowoczesnapolska.org.pl/ML/Lektury/1.1">
<xsl:template match="strofa">
<xsl:element name="stanza" namespace="http://nowoczesnapolska.org.pl/ML/Lektury/1.1">
@@
-105,7
+111,7
@@
<xsl:template match="akap_dialog">
<xsl:element name="pd">
<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>
<xsl:value-of select="wlf:fix-dialog-line($prolog)" />
<xsl:apply-templates select="@*|*|text()[. != $prolog]" />
</xsl:element>
@@
-140,7
+146,7
@@
<xsl:when test="starts-with(., '.')">
<xsl:attribute name="type">dot</xsl:attribute>
</xsl:when>
<xsl:when test="starts-with(., '.')">
<xsl:attribute name="type">dot</xsl:attribute>
</xsl:when>
- </xsl:choose>
+ </xsl:choose>
</xsl:element>
</xsl:template>
</xsl:element>
</xsl:template>
@@
-238,7
+244,7
@@
<xsl:template match="motto">
<xsl:element name="motto">
<xsl:apply-templates select="@*|node()" />
<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()" />
<xsl:variable name="sign" select="following-sibling::*[1][name() = 'motto_podpis']" />
<signature>
<xsl:apply-templates select="$sign/node()" />
@@
-247,7
+253,7
@@
</xsl:template>
<xsl:template match="motto_podpis[preceding-sibling::*[1][name() = 'motto']]" />
</xsl:template>
<xsl:template match="motto_podpis[preceding-sibling::*[1][name() = 'motto']]" />
-
+
<xsl:template match="lista_osob">
<person-list>
<xsl:apply-templates select="@*|node()" />
<xsl:template match="lista_osob">
<person-list>
<xsl:apply-templates select="@*|node()" />
@@
-270,7
+276,7
@@
<xsl:template match="sekcja_swiatlo">
<vertical-space />
</xsl:template>
<xsl:template match="sekcja_swiatlo">
<vertical-space />
</xsl:template>
-
+
<xsl:template match="sekcja_asterysk">
<vertical-space type="asterisk" />
</xsl:template>
<xsl:template match="sekcja_asterysk">
<vertical-space type="asterisk" />
</xsl:template>
@@
-303,7
+309,7
@@
</xsl:template>
<xsl:template match="naglowek_osoba[following-sibling::*[1][name() = 'kwestia']]" />
</xsl:template>
<xsl:template match="naglowek_osoba[following-sibling::*[1][name() = 'kwestia']]" />
-
+
<!-- Inne -->
<xsl:template match="osoba">
<xsl:element name="person-ref">
<!-- Inne -->
<xsl:template match="osoba">
<xsl:element name="person-ref">
@@
-323,6
+329,12
@@
</xsl:element>
</xsl:template>
</xsl:element>
</xsl:template>
+ <xsl:template match="indeks_dolny">
+ <xsl:element name="sub">
+ <xsl:apply-templates select="@*|node()" />
+ </xsl:element>
+ </xsl:template>
+
<xsl:template match="mat">
<xsl:element name="math">
<xsl:apply-templates select="@*|node()" />
<xsl:template match="mat">
<xsl:element name="math">
<xsl:apply-templates select="@*|node()" />
@@
-351,7
+363,7
@@
<!-- Copy attributes -->
<xsl:template match="@*|comment()">
<xsl:copy />
<!-- 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()">
<!-- Inside RDF meta-data, leave the text unchanged -->
<xsl:template match="rdf:RDF//text()">
@@
-372,7
+384,7
@@
<!-- Ignoruj RDF poza meta -->
<xsl:template match="rdf:*|dc:*" />
<!-- Ignoruj RDF poza meta -->
<xsl:template match="rdf:*|dc:*" />
-
+
<xsl:template match="@*|node()" mode="meta">
<xsl:copy>
<xsl:apply-templates match="@*|node()" mode="meta" />
<xsl:template match="@*|node()" mode="meta">
<xsl:copy>
<xsl:apply-templates match="@*|node()" mode="meta" />
@@
-383,11
+395,11
@@
<xsl:template match="node()">
<xsl:message>
<xsl:text>Nieprzetworzony węzeł:</xsl:text>
<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:message>
<unparsed-node>
<xsl:copy-of select="." />
</unparsed-node>
</xsl:template>
-
+
</xsl:stylesheet>
\ No newline at end of file
</xsl:stylesheet>
\ No newline at end of file