fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
All rules from html2wl are now implemented.
[redakcja.git]
/
platforma
/
static
/
xsl
/
wl2html_client.xsl
diff --git
a/platforma/static/xsl/wl2html_client.xsl
b/platforma/static/xsl/wl2html_client.xsl
index
d7f397d
..
2326d26
100644
(file)
--- a/
platforma/static/xsl/wl2html_client.xsl
+++ b/
platforma/static/xsl/wl2html_client.xsl
@@
-1,3
+1,4
@@
+<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:stylesheet version="1.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
@@
-5,11
+6,7
@@
<!--
Dokument ten opisuje jednoznaczne przeksztaĆcenie WLML 0.1 -> XHTML.
-->
<!--
Dokument ten opisuje jednoznaczne przeksztaĆcenie WLML 0.1 -> XHTML.
-->
- <xsl:output method="xml" encoding="utf-8" indent="no" omit-xml-declaration="yes" />
-
- <!-- <xsl:template match="/">
- <xsl:apply-templates select="chunk|utwor" />
- </xsl:template> -->
+ <xsl:output method="html" omit-xml-declaration="yes" encoding="utf-8" indent="no" />
<!--
Base tag for rendering a fragment of text
<!--
Base tag for rendering a fragment of text
@@
-27,7
+24,7
@@
<xsl:template match="utwor">
<div>
<xsl:call-template name="standard-attributes" />
<xsl:template match="utwor">
<div>
<xsl:call-template name="standard-attributes" />
- <xsl:apply-templates select="child::
* | text
()">
+ <xsl:apply-templates select="child::
node
()">
<xsl:with-param name="mixed" select="false()" />
</xsl:apply-templates>
</div>
<xsl:with-param name="mixed" select="false()" />
</xsl:apply-templates>
</div>
@@
-545,7
+542,7
@@
<xsl:choose>
<!-- Simple verse == not wers_ tags anywhere until the ending br -->
<xsl:when test="not($verse-content[starts-with(name(), 'wers_')])">
<xsl:choose>
<!-- Simple verse == not wers_ tags anywhere until the ending br -->
<xsl:when test="not($verse-content[starts-with(name(), 'wers_')])">
- <p class="wers" x-node="wers">
+ <p class="wers" x-node="wers"
x-verse="true"
>
<xsl:apply-templates select="$verse-content[local-name(.) != 'br']">
<xsl:with-param name="mixed" select="true()" />
</xsl:apply-templates>
<xsl:apply-templates select="$verse-content[local-name(.) != 'br']">
<xsl:with-param name="mixed" select="true()" />
</xsl:apply-templates>
@@
-562,7
+559,7
@@
<xsl:template match="wers_cd|wers_akap|wers_wciety">
<xsl:param name="mixed" />
<xsl:template match="wers_cd|wers_akap|wers_wciety">
<xsl:param name="mixed" />
- <p>
+ <p
x-verse="true"
>
<xsl:call-template name="standard-attributes" />
<xsl:apply-templates select="child::node()">
<xsl:with-param name="mixed" select="true()" />
<xsl:call-template name="standard-attributes" />
<xsl:apply-templates select="child::node()">
<xsl:with-param name="mixed" select="true()" />
@@
-648,7
+645,7
@@
<!-- the link to the non-inline version -->
<a href="#annotation-{generate-id(.)}" class="annotation"></a>
<!-- inline contents -->
<!-- the link to the non-inline version -->
<a href="#annotation-{generate-id(.)}" class="annotation"></a>
<!-- inline contents -->
- <span x-annotation-box="true">
+ <span x-annotation-box="true"
x-pass-thru="true"
>
<xsl:call-template name="context-menu" />
<xsl:apply-templates select="node()">
<xsl:with-param name="mixed" select="true()" />
<xsl:call-template name="context-menu" />
<xsl:apply-templates select="node()">
<xsl:with-param name="mixed" select="true()" />
@@
-680,7
+677,7
@@
<xsl:value-of select="substring-after(@id, 'm')" />
</xsl:attribute>
<xsl:call-template name="context-menu" />
<xsl:value-of select="substring-after(@id, 'm')" />
</xsl:attribute>
<xsl:call-template name="context-menu" />
- <span class="theme-text-list"><xsl:value-of select=".|node()" /></span>
+ <span
x-pass-thru="true"
class="theme-text-list"><xsl:value-of select=".|node()" /></span>
</span>
</xsl:template>
</span>
</xsl:template>
@@
-705,7
+702,11
@@
<xsl:param name="mixed" />
<xsl:choose>
<xsl:when test="normalize-space(.) = ''" />
<xsl:param name="mixed" />
<xsl:choose>
<xsl:when test="normalize-space(.) = ''" />
- <xsl:when test="not($mixed)"><div x-node="out-of-flow-text" class="out-of-flow-text" x-editable="true"><xsl:value-of select="." /></div></xsl:when>
+ <xsl:when test="not($mixed)">
+ <span x-node="out-of-flow-text" class="out-of-flow-text" x-editable="true">
+ <xsl:value-of select="." />
+ </span>
+ </xsl:when>
<xsl:otherwise><xsl:value-of select="." /></xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:otherwise><xsl:value-of select="." /></xsl:otherwise>
</xsl:choose>
</xsl:template>
@@
-746,8
+747,7
@@
<xsl:param name="extra-class" />
<xsl:attribute name="class"><xsl:value-of select="local-name()" /><xsl:text> </xsl:text><xsl:value-of select="$extra-class" /></xsl:attribute>
<xsl:param name="extra-class" />
<xsl:attribute name="class"><xsl:value-of select="local-name()" /><xsl:text> </xsl:text><xsl:value-of select="$extra-class" /></xsl:attribute>
- <!-- we use upper-case attribute names, so we don't have to wory about HTML parsers -->
- <xsl:attribute name="x-node"><xsl:value-of select="name()" /></xsl:attribute>
+ <xsl:attribute name="x-node"><xsl:value-of select="local-name()" /></xsl:attribute>
<xsl:if test="local-name() != name()">
<xsl:attribute name="x-ns"><xsl:value-of select="namespace-uri()" /></xsl:attribute>
<xsl:if test="local-name() != name()">
<xsl:attribute name="x-ns"><xsl:value-of select="namespace-uri()" /></xsl:attribute>
@@
-756,7
+756,7
@@
<xsl:for-each select="@*">
<xsl:variable name="id" select="generate-id()" />
<xsl:attribute name="x-attr-value-{$id}"><xsl:value-of select="."/></xsl:attribute>
<xsl:for-each select="@*">
<xsl:variable name="id" select="generate-id()" />
<xsl:attribute name="x-attr-value-{$id}"><xsl:value-of select="."/></xsl:attribute>
- <xsl:attribute name="x-attr-
qname-{$id}"><xsl:value-of select="
name()"/></xsl:attribute>
+ <xsl:attribute name="x-attr-
name-{$id}"><xsl:value-of select="local-
name()"/></xsl:attribute>
<xsl:if test="namespace-uri()">
<xsl:attribute name="x-attr-ns-{$id}"><xsl:value-of select="namespace-uri()"/></xsl:attribute>
</xsl:if>
<xsl:if test="namespace-uri()">
<xsl:attribute name="x-attr-ns-{$id}"><xsl:value-of select="namespace-uri()"/></xsl:attribute>
</xsl:if>