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"/>
\r
12 Ten dokument definiuję przekształcenie odwrotne do wl2html
\r
16 <xsl:template match="comment()"><xsl:copy /></xsl:template>
\r
18 <!-- libxslt has fuck-ed prorities -->
\r
19 <!-- <xsl:template match="@*[not(starts-with(name(), 'x-')) and name() != 'class']">
\r
20 <xsl:message>Boom!: <xsl:value-of select="name()" /></xsl:message>
\r
23 <xsl:template match="@*" priority="0" />
\r
25 <!-- Specjalne reguły dla przypisów -->
\r
26 <xsl:template match="*[@x-annotation-box]">
\r
27 <xsl:apply-templates select="node()" />
\r
30 <xsl:template match="*[@x-node]">
\r
31 <xsl:element name="{@x-node}" namespace="{@x-ns}">
\r
32 <xsl:apply-templates select="@*" />
\r
33 <xsl:apply-templates select="node()" />
\r
37 <xsl:template match="*[@x-node = 'out-of-flow-text']"><xsl:value-of select="@x-content" /></xsl:template>
\r
39 <!-- Specjalne reguły dla wersów -->
\r
40 <xsl:template match="*[@x-node = 'wers']">
\r
41 <xsl:apply-templates select="node()" />
\r
42 <xsl:if test="count(following-sibling::*[starts-with(@x-node, 'wers')]) > 0"><xsl:text>/
</xsl:text></xsl:if>
\r
45 <xsl:template match="*[starts-with(@x-node, 'wers_')]">
\r
46 <xsl:element name="{@x-node}" namespace="{@x-ns}"><xsl:apply-templates select="@*|node()" /></xsl:element>
\r
47 <xsl:if test="count(following-sibling::*[starts-with(@x-node, 'wers')]) > 0"><xsl:text>/
</xsl:text></xsl:if>
\r
50 <xsl:template match="@*[starts-with(name(), 'x-attr-qname-')]">
\r
51 <xsl:variable name="attr-id" select="substring-after(name(), 'x-attr-qname-')" />
\r
52 <xsl:attribute name="{.}" namespace="{parent::*/@*[name() = concat('x-attr-ns-', $attr-id)]}">
\r
53 <xsl:value-of select="parent::*/@*[name() = concat('x-attr-value-', $attr-id)]" />
\r
57 <!-- upper case duplicates for the brain-dead Firefox -->
\r
59 <xsl:template match="@*[starts-with(name(), 'X-ATTR-QNAME-')]">
\r
60 <xsl:variable name="attr-id" select="substring-after(name(), 'X-ATTR-QNAME-')" />
\r
61 <xsl:attribute name="{.}" namespace="{parent::*/@*[name() = concat('X-ATTR-NS-', $attr-id)]}">
\r
62 <xsl:value-of select="parent::*/@*[name() = concat('X-ATTR-VALUE-', $attr-id)]" />
\r
66 <xsl:template match="*[@X-ANNOTATION-BOX]">
\r
67 <xsl:apply-templates select="node()" />
\r
70 <xsl:template match="*[@X-NODE]">
\r
71 <xsl:element name="{@X-NODE}" namespace="{@X-NS}">
\r
72 <xsl:apply-templates select="@*" />
\r
73 <xsl:apply-templates select="node()" />
\r
77 <xsl:template match="*[@X-NODE = 'out-of-flow-text']"><xsl:value-of select="@X-CONTENT" /></xsl:template>
\r
79 <!-- Specjalne reguły dla wersów -->
\r
80 <xsl:template match="*[@X-NODE = 'wers']">
\r
81 <xsl:apply-templates select="node()" />
\r
82 <xsl:if test="count(following-sibling::*[starts-with(@X-NODE, 'wers')]) > 0"><xsl:text>/
</xsl:text></xsl:if>
\r
85 <xsl:template match="*[starts-with(@X-NODE, 'wers_')]">
\r
86 <xsl:element name="{@X-NODE}" namespace="{@X-NS}"><xsl:apply-templates select="@*|node()" /></xsl:element>
\r
87 <xsl:if test="count(following-sibling::*[starts-with(@X-NODE, 'wers')]) > 0"><xsl:text>/
</xsl:text></xsl:if>
\r
92 <xsl:template match="*" />
\r