]> granicus.if.org Git - docbook-dsssl/commitdiff
Converts xhtml/docbook.xsl for xhtml5.
authorBob Stayton <bobs@sagehill.net>
Tue, 31 Jan 2012 01:07:37 +0000 (01:07 +0000)
committerBob Stayton <bobs@sagehill.net>
Tue, 31 Jan 2012 01:07:37 +0000 (01:07 +0000)
xsl/xhtml5/xhtml2xhtml5.xsl [new file with mode: 0644]

diff --git a/xsl/xhtml5/xhtml2xhtml5.xsl b/xsl/xhtml5/xhtml2xhtml5.xsl
new file mode 100644 (file)
index 0000000..72a1016
--- /dev/null
@@ -0,0 +1,39 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:xslo="http://www.w3.org/1999/XSL/TransformAlias"
+                version="1.0">
+
+<xsl:output indent="no"/>
+
+<xsl:namespace-alias stylesheet-prefix="xslo" result-prefix="xsl"/>
+
+<xsl:template match="node()|@*">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates/>
+   </xsl:copy>
+</xsl:template>
+
+<xsl:template match="xsl:output">
+  <xsl:comment>Same as xhtml but with doctypes removed from xsl:output </xsl:comment>
+  <xsl:text>&#10;</xsl:text>
+  <xsl:comment>and including from ../xhtml directory </xsl:comment>
+  <xsl:text>&#10;</xsl:text>
+  <xslo:output method="xml" encoding="UTF-8" indent="no"/>
+</xsl:template>
+
+<xsl:template match="xsl:include/@href">
+  <xsl:choose>
+    <xsl:when test="starts-with(., '../')">
+      <xsl:copy-of select="."/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:attribute name="href">
+        <xsl:value-of select="concat('../xhtml/', .)"/>
+      </xsl:attribute>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:include href="../common/subtitles.xsl"/>
+</xsl:stylesheet>
+