4 xmlns:html="http://www.w3.org/1999/xhtml"
\r
5 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
\r
6 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
\r
7 xmlns:dc="http://purl.org/dc/elements/1.1/"
\r
10 <xsl:output method="xml" encoding="utf-8" indent="yes" omit-xml-declaration="yes" />
\r
12 Ten dokument definiuję przekształcenie odwrotne do wl2html
\r
15 <xsl:template match="comment()"><xsl:copy /></xsl:template>
\r
17 <!-- libxslt has fuck-ed prorities -->
\r
18 <!-- <xsl:template match="@*[not(starts-with(name(), 'x-')) and name() != 'class']">
\r
19 <xsl:message>Boom!: <xsl:value-of select="name()" /></xsl:message>
\r
22 <xsl:template match="@*" priority="0" />
\r
24 <!-- Specjalne reguły dla przypisów -->
\r
25 <xsl:template match="*[@x-annotation-box]|*[@class='theme-text-list']">
\r
26 <xsl:apply-templates select="node()" />
\r
29 <xsl:template match="*[@x-node]">
\r
30 <xsl:element name="{@x-node}" namespace="{@x-ns}">
\r
31 <xsl:apply-templates select="@*" />
\r
32 <xsl:apply-templates select="node()" />
\r
36 <xsl:template match="*[@x-node = 'out-of-flow-text']"><xsl:value-of select="." /></xsl:template>
\r
38 <!-- Specjalne reguły dla wersów -->
\r
39 <xsl:template match="*[@x-node = 'wers']">
\r
40 <xsl:apply-templates select="node()" />
\r
41 <xsl:if test="count(following-sibling::*[starts-with(@x-node, 'wers')]) > 0"><xsl:text>/
</xsl:text></xsl:if>
\r
44 <xsl:template match="*[starts-with(@x-node, 'wers_')]">
\r
45 <xsl:element name="{@x-node}" namespace="{@x-ns}"><xsl:apply-templates select="@*|node()" /></xsl:element>
\r
46 <xsl:if test="count(following-sibling::*[starts-with(@x-node, 'wers')]) > 0"><xsl:text>/
</xsl:text></xsl:if>
\r
49 <xsl:template match="@*[starts-with(name(), 'x-attr-qname-')]">
\r
50 <xsl:variable name="attr-id" select="substring-after(name(), 'x-attr-qname-')" />
\r
51 <xsl:attribute name="{.}" namespace="{parent::*/@*[name() = concat('x-attr-ns-', $attr-id)]}">
\r
52 <xsl:value-of select="parent::*/@*[name() = concat('x-attr-value-', $attr-id)]" />
\r
56 <!-- upper case duplicates for the brain-dead Firefox -->
\r
58 <xsl:template match="@*[starts-with(name(), 'X-ATTR-QNAME-')]">
\r
59 <xsl:variable name="attr-id" select="substring-after(name(), 'X-ATTR-QNAME-')" />
\r
60 <xsl:attribute name="{.}" namespace="{parent::*/@*[name() = concat('X-ATTR-NS-', $attr-id)]}">
\r
61 <xsl:value-of select="parent::*/@*[name() = concat('X-ATTR-VALUE-', $attr-id)]" />
\r
65 <xsl:template match="*[@X-ANNOTATION-BOX]">
\r
66 <xsl:apply-templates select="node()" />
\r
69 <xsl:template match="*[@X-NODE]">
\r
70 <xsl:element name="{@X-NODE}" namespace="{@X-NS}">
\r
71 <xsl:apply-templates select="@*" />
\r
72 <xsl:apply-templates select="node()" />
\r
76 <xsl:template match="*[@X-NODE = 'out-of-flow-text']"><xsl:value-of select="@X-CONTENT" /></xsl:template>
\r
78 <!-- Specjalne reguły dla wersów -->
\r
79 <xsl:template match="*[@X-NODE = 'wers']">
\r
80 <xsl:apply-templates select="node()" />
\r
81 <xsl:if test="count(following-sibling::*[starts-with(@X-NODE, 'wers')]) > 0"><xsl:text>/
</xsl:text></xsl:if>
\r
84 <xsl:template match="*[starts-with(@X-NODE, 'wers_')]">
\r
85 <xsl:element name="{@X-NODE}" namespace="{@X-NS}"><xsl:apply-templates select="@*|node()" /></xsl:element>
\r
86 <xsl:if test="count(following-sibling::*[starts-with(@X-NODE, 'wers')]) > 0"><xsl:text>/
</xsl:text></xsl:if>
\r
89 <xsl:template match="*" />
\r