[yelp-xsl] Starting to experiment with DITA support



commit 49453bda89b856a618ca2e45853908d1995d1f0f
Author: Shaun McCance <shaunm gnome org>
Date:   Tue Oct 2 14:26:11 2012 -0400

    Starting to experiment with DITA support

 xslt/dita/html/dita2html-block.xsl  |  199 +++++++++++++++++++++++++++++
 xslt/dita/html/dita2html-inline.xsl |   92 ++++++++++++++
 xslt/dita/html/dita2html-list.xsl   |  131 +++++++++++++++++++
 xslt/dita/html/dita2html-topic.xsl  |  235 +++++++++++++++++++++++++++++++++++
 xslt/dita/html/dita2xhtml.xsl       |   83 ++++++++++++
 xslt/dita/html/selectors.mod        |  226 +++++++++++++++++++++++++++++++++
 6 files changed, 966 insertions(+), 0 deletions(-)
---
diff --git a/xslt/dita/html/dita2html-block.xsl b/xslt/dita/html/dita2html-block.xsl
new file mode 100644
index 0000000..dcfb763
--- /dev/null
+++ b/xslt/dita/html/dita2html-block.xsl
@@ -0,0 +1,199 @@
+<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
+<!--
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your option) any
+later version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this program; see the file COPYING.LGPL.  If not, write to the
+Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA.
+-->
+<!DOCTYPE xsl:stylesheet [
+<!ENTITY % selectors SYSTEM "selectors.mod">
+%selectors;
+]>
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+                xmlns="http://www.w3.org/1999/xhtml";
+                version="1.0">
+
+<!--!!==========================================================================
+DITA to HTML - Blocks
+
+REMARK: Describe this module
+-->
+
+
+<!-- == Matched Templates == -->
+
+<!-- = cmd = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_cmd;">
+  <p>
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:apply-templates mode="dita2html.topic.mode"/>
+  </p>
+</xsl:template>
+
+<!-- = codeblock = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_codeblock;">
+  <div class="code">
+    <xsl:call-template name="html.lang.attrs"/>
+    <pre class="contents">
+      <xsl:apply-templates mode="dita2html.topic.mode"/>
+    </pre>
+  </div>
+</xsl:template>
+
+<!-- = context = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_context;">
+  <div class="context">
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:apply-templates mode="dita2html.topic.mode"/>
+  </div>
+</xsl:template>
+
+<!-- = desc = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_desc;">
+  <div class="desc">
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:apply-templates mode="dita2html.topic.mode"/>
+  </div>
+</xsl:template>
+
+<!-- = info = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_info;">
+  <p>
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:apply-templates mode="dita2html.topic.mode"/>
+  </p>
+</xsl:template>
+
+<!-- = note = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_note;">
+  <xsl:variable name="notetype">
+    <xsl:choose>
+      <xsl:when test="@type = 'attention' or @type = 'important' or
+                      @type = 'remember' or @type = 'restriction'">
+        <xsl:text>important</xsl:text>
+      </xsl:when>
+      <xsl:when test="@type = 'caution' or @type = 'danger' or
+                      @type = 'notice' or @type = 'warning'">
+        <xsl:text>warning</xsl:text>
+      </xsl:when>
+      <xsl:when test="@type = 'fastpath' or @type = 'tip'">
+        <xsl:text>tip</xsl:text>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:variable>
+  <div>
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:attribute name="class">
+      <xsl:text>note</xsl:text>
+      <xsl:if test="$notetype != ''">
+        <xsl:text> note-</xsl:text>
+        <xsl:value-of select="$notetype"/>
+      </xsl:if>
+    </xsl:attribute>
+    <div class="inner">
+      <div class="region">
+        <div class="contents">
+          <xsl:apply-templates mode="dita2html.topic.mode"/>
+        </div>
+      </div>
+    </div>
+  </div>
+</xsl:template>
+
+<!-- = p = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_p;">
+  <p>
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:apply-templates mode="dita2html.topic.mode"/>
+  </p>
+</xsl:template>
+
+<!-- = postreq = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_postreq;">
+  <div class="postreq">
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:apply-templates mode="dita2html.topic.mode"/>
+  </div>
+</xsl:template>
+
+<!-- = prereq = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_prereq;">
+  <div class="prereq">
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:apply-templates mode="dita2html.topic.mode"/>
+  </div>
+</xsl:template>
+
+<!-- = result = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_result;">
+  <div class="result">
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:apply-templates mode="dita2html.topic.mode"/>
+  </div>
+</xsl:template>
+
+<!-- = shortdesc = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_shortdesc;">
+  <p class="shortdesc">
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:apply-templates mode="dita2html.topic.mode"/>
+  </p>
+</xsl:template>
+
+<!-- = stepresult = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_stepresult;">
+  <p>
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:apply-templates mode="dita2html.topic.mode"/>
+  </p>
+</xsl:template>
+
+<!-- = stepxmp = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_stepxmp;">
+  <div class="example">
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:apply-templates mode="dita2html.topic.mode"/>
+  </div>
+</xsl:template>
+
+<!-- = title = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_title;">
+  <xsl:variable name="depth" select="count(ancestor::&topic_topic_all;) + 1"/>
+  <xsl:variable name="depth_">
+    <xsl:choose>
+      <xsl:when test="$depth &lt; 6">
+        <xsl:value-of select="$depth"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="6"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+  <div class="title">
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:element name="{concat('h', $depth_)}" namespace="{$html.namespace}">
+      <xsl:apply-templates mode="dita2html.topic.mode"/>
+    </xsl:element>
+  </div>
+</xsl:template>
+
+<!-- = tutorialinfo = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_tutorialinfo;">
+  <p>
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:apply-templates mode="dita2html.topic.mode"/>
+  </p>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/xslt/dita/html/dita2html-inline.xsl b/xslt/dita/html/dita2html-inline.xsl
new file mode 100644
index 0000000..6a28840
--- /dev/null
+++ b/xslt/dita/html/dita2html-inline.xsl
@@ -0,0 +1,92 @@
+<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
+<!--
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your option) any
+later version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this program; see the file COPYING.LGPL.  If not, write to the
+Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA.
+-->
+<!DOCTYPE xsl:stylesheet [
+<!ENTITY % selectors SYSTEM "selectors.mod">
+%selectors;
+]>
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+                xmlns="http://www.w3.org/1999/xhtml";
+                version="1.0">
+
+<!--!!==========================================================================
+DITA to HTML - Inlines
+
+REMARK: Describe this module
+-->
+
+
+<!-- == Matched Templates == -->
+
+<!-- = codeph = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_codeph;">
+  <span class="code">
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:apply-templates mode="dita2html.topic.mode"/>
+  </span>
+</xsl:template>
+
+<!-- = cmdname = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_cmdname;">
+  <span class="cmd">
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:apply-templates mode="dita2html.topic.mode"/>
+  </span>
+</xsl:template>
+
+<!-- = filepath = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_filepath;">
+  <span class="file">
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:apply-templates mode="dita2html.topic.mode"/>
+  </span>
+</xsl:template>
+
+<!-- = systemoutput = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_systemoutput;">
+  <span class="output">
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:apply-templates mode="dita2html.topic.mode"/>
+  </span>
+</xsl:template>
+
+<!-- = uicontrol = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_uicontrol;">
+  <span class="gui">
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:apply-templates mode="dita2html.topic.mode"/>
+  </span>
+</xsl:template>
+
+<!-- = userinput = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_userinput;">
+  <span class="input">
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:apply-templates mode="dita2html.topic.mode"/>
+  </span>
+</xsl:template>
+
+<!-- = varname = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_varname;">
+  <span class="var">
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:apply-templates mode="dita2html.topic.mode"/>
+  </span>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/xslt/dita/html/dita2html-list.xsl b/xslt/dita/html/dita2html-list.xsl
new file mode 100644
index 0000000..db626e1
--- /dev/null
+++ b/xslt/dita/html/dita2html-list.xsl
@@ -0,0 +1,131 @@
+<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
+<!--
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your option) any
+later version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this program; see the file COPYING.LGPL.  If not, write to the
+Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA.
+-->
+<!DOCTYPE xsl:stylesheet [
+<!ENTITY % selectors SYSTEM "selectors.mod">
+%selectors;
+]>
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+                xmlns="http://www.w3.org/1999/xhtml";
+                version="1.0">
+
+<!--!!==========================================================================
+DITA to HTML - Lists
+
+REMARK: Describe this module
+-->
+
+
+<!-- == Matched Templates == -->
+
+<!-- = li = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_li;">
+  <li class="list">
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:apply-templates mode="dita2html.topic.mode"/>
+  </li>
+</xsl:template>
+
+<!-- = ul = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_ol;">
+  <div class="list">
+    <xsl:call-template name="html.lang.attrs"/>
+    <div class="inner">
+      <ol class="list">
+        <xsl:apply-templates mode="dita2html.topic.mode"/>
+      </ol>
+    </div>
+  </div>
+</xsl:template>
+
+<!-- = step = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_step;">
+  <xsl:variable name="pre" select="preceding-sibling::&topic_step;"/>
+  <li class="steps" value="{count($pre) + 1}">
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:apply-templates mode="dita2html.topic.mode"/>
+  </li>
+</xsl:template>
+
+<!-- = steps = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_steps;">
+  <div class="steps">
+    <xsl:call-template name="html.lang.attrs"/>
+    <div class="inner">
+      <div class="region">
+        <ol class="steps">
+          <xsl:apply-templates mode="dita2html.topic.mode"/>
+        </ol>
+      </div>
+    </div>
+  </div>
+</xsl:template>
+
+<!-- = steps-unordered = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_steps-unordered;">
+  <div class="steps">
+    <xsl:call-template name="html.lang.attrs"/>
+    <div class="inner">
+      <div class="region">
+        <ul class="steps">
+          <xsl:apply-templates mode="dita2html.topic.mode"/>
+        </ul>
+      </div>
+    </div>
+  </div>
+</xsl:template>
+
+<!-- = stepsection = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_stepsection;">
+  <li class="stepsection">
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:apply-templates mode="dita2html.topic.mode"/>
+  </li>
+</xsl:template>
+
+<!-- = substep = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_substep;">
+  <li class="steps substeps">
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:apply-templates mode="dita2html.topic.mode"/>
+  </li>
+</xsl:template>
+
+<!-- = substeps = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_substeps;">
+  <div class="substeps">
+    <xsl:call-template name="html.lang.attrs"/>
+    <ol class="substeps">
+      <xsl:apply-templates mode="dita2html.topic.mode"/>
+    </ol>
+  </div>
+</xsl:template>
+
+<!-- = ul = -->
+<xsl:template mode="dita2html.topic.mode" match="&topic_ul;">
+  <div class="list">
+    <xsl:call-template name="html.lang.attrs"/>
+    <div class="inner">
+      <ul class="list">
+        <xsl:apply-templates mode="dita2html.topic.mode"/>
+      </ul>
+    </div>
+  </div>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/xslt/dita/html/dita2html-topic.xsl b/xslt/dita/html/dita2html-topic.xsl
new file mode 100644
index 0000000..ecede8f
--- /dev/null
+++ b/xslt/dita/html/dita2html-topic.xsl
@@ -0,0 +1,235 @@
+<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
+<!--
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your option) any
+later version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this program; see the file COPYING.LGPL.  If not, write to the
+Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA.
+-->
+<!DOCTYPE xsl:stylesheet [
+<!ENTITY % selectors SYSTEM "selectors.mod">
+%selectors;
+]>
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+                xmlns:msg="http://projects.gnome.org/yelp/gettext/";
+                xmlns="http://www.w3.org/1999/xhtml";
+                exclude-result-prefixes="msg"
+                version="1.0">
+
+<!--!!==========================================================================
+DITA to HTML - Topics
+
+REMARK: Describe this module
+-->
+
+
+<!-- == Matched Templates == -->
+
+<!--%# html.title.mode -->
+<xsl:template mode="html.title.mode" match="&topic_topic;">
+  <xsl:value-of select="&topic_title;"/>
+</xsl:template>
+
+<!--%# html.header.mode -->
+<xsl:template mode="html.header.mode" match="&topic_topic;">
+  <div class="trails">
+  </div>
+  <!-- FIXME -->
+  <!--
+  <xsl:call-template name="mal2html.page.linktrails"/>
+  -->
+</xsl:template>
+
+<!--%# html.footer.mode -->
+<xsl:template mode="html.footer.mode" match="&topic_topic;">
+  <!-- FIXME -->
+  <!--
+  <xsl:call-template name="mal2html.page.about"/>
+  -->
+</xsl:template>
+
+<!--%# html.body.mode -->
+<xsl:template mode="html.body.mode" match="&topic_topic;">
+  <!-- FIXME: prevnext -->
+  <xsl:apply-templates mode="dita2html.topic.mode" select="."/>
+  <div class="clear"/>
+</xsl:template>
+
+<!--%# html.css.mode -->
+<xsl:template mode="html.css.mode" match="&topic_topic;">
+  <xsl:param name="direction">
+    <xsl:call-template name="l10n.direction"/>
+  </xsl:param>
+  <xsl:param name="left">
+    <xsl:call-template name="l10n.align.start">
+      <xsl:with-param name="direction" select="$direction"/>
+    </xsl:call-template>
+  </xsl:param>
+  <xsl:param name="right">
+    <xsl:call-template name="l10n.align.end">
+      <xsl:with-param name="direction" select="$direction"/>
+    </xsl:call-template>
+  </xsl:param>
+<xsl:text>
+li.stepsection {
+  margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 0;
+  list-style-type: none;
+}
+<!-- FIXME: perhaps into html.xsl? -->
+div.links > div.inner > div.region > div.desc { font-style: italic; }
+</xsl:text>
+</xsl:template>
+
+
+
+<xsl:template mode="dita2html.topic.mode" match="&topic_topic;">
+  <xsl:variable name="depth" select="count(ancestor::*) + 1"/>
+  <xsl:variable name="depth_">
+    <xsl:choose>
+      <xsl:when test="$depth &lt; 6">
+        <xsl:value-of select="$depth"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="6"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+  <div class="hgroup">
+    <xsl:element name="{concat('h', $depth_)}" namespace="{$html.namespace}">
+      <xsl:attribute name="class">
+        <xsl:text>title</xsl:text>
+      </xsl:attribute>
+      <span class="title">
+        <xsl:for-each select="&topic_title;">
+          <xsl:apply-templates mode="dita2html.topic.mode"/>
+        </xsl:for-each>
+      </span>
+    </xsl:element>
+  </div>
+  <xsl:apply-templates mode="dita2html.topic.mode" select="&topic_body;"/>
+  <xsl:apply-templates mode="dita2html.topic.mode" select="&topic_topic;"/>
+  <xsl:apply-templates mode="dita2html.topic.mode" select="&topic_related-links;"/>
+</xsl:template>
+
+<xsl:template mode="dita2html.topic.mode" match="&topic_body;">
+  <div class="region">
+    <xsl:call-template name="html.lang.attrs"/>
+    <div class="contents">
+      <xsl:apply-templates mode="dita2html.topic.mode"/>
+    </div>
+  </div>
+</xsl:template>
+
+<xsl:template mode="dita2html.topic.mode" match="&topic_related-links;">
+  <div class="sect sect-links">
+    <div class="hgroup"/>
+    <div class="contents">
+      <div class="links">
+        <div class="inner">
+          <div class="region">
+            <ul>
+              <xsl:apply-templates mode="dita2html.topic.mode"/>
+            </ul>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</xsl:template>
+
+<xsl:template mode="dita2html.topic.mode" match="&topic_link;">
+  <!-- FIXME -->
+  <li class="links">
+    <xsl:call-template name="html.lang.attrs"/>
+    <a>
+      <xsl:attribute name="href">
+        <!-- FIXME -->
+        <xsl:value-of select="@href"/>
+      </xsl:attribute>
+      <xsl:variable name="linktext" select="&topic_linktext;"/>
+      <xsl:choose>
+        <xsl:when test="$linktext">
+          <xsl:for-each select="$linktext[1]">
+            <span class="linktext">
+              <xsl:call-template name="html.lang.attrs"/>
+              <xsl:apply-templates mode="dita2html.topic.mode"/>
+            </span>
+          </xsl:for-each>
+        </xsl:when>
+        <xsl:otherwise>
+          <!-- FIXME -->
+          <xsl:value-of select="@href"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </a>
+    <xsl:variable name="desc" select="&topic_desc;"/>
+    <xsl:for-each select="$desc[1]">
+      <span class="desc">
+        <xsl:call-template name="html.lang.attrs"/>
+        <xsl:text> &#x2014; </xsl:text>
+        <xsl:apply-templates mode="dita2html.topic.mode"/>
+      </span>
+    </xsl:for-each>
+  </li>
+</xsl:template>
+
+<xsl:template mode="dita2html.topic.mode" match="&topic_linkinfo;">
+  <li class="links links-linkinfo">
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:apply-templates modes="dita2html.topic.mode"/>
+  </li>
+</xsl:template>
+
+<xsl:template mode="dita2html.topic.mode" match="&topic_linklist;">
+  <xsl:choose>
+    <xsl:when test="&topic_title; or &topic_desc; or &topic_linkinfo;">
+      <li class="links">
+        <div class="links">
+          <xsl:call-template name="html.lang.attrs"/>
+          <div class="inner">
+            <xsl:apply-templates mode="dita2html.topic.mode" select="&topic_title;"/>
+            <div class="region">
+              <xsl:apply-templates mode="dita2html.topic.mode" select="&topic_desc;"/>
+              <ul>
+                <xsl:apply-templates mode="dita2html.topic.mode" select="&topic_link; | &topic_linklist;"/>
+                <xsl:apply-templates mode="dita2html.topic.mode" select="&topic_linkinfo;"/>
+              </ul>
+            </div>
+          </div>
+        </div>
+      </li>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates mode="dita2html.topic.mode"
+                           select="&topic_link; | &topic_linklist;"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template mode="dita2html.topic.mode" match="&topic_linkpool;">
+  <xsl:apply-templates mode="dita2html.topic.mode"/>
+</xsl:template>
+
+<!-- FIXME -->
+
+<xsl:template mode="dita2html.topic.mode" match="&topic_prolog;"/>
+
+<xsl:template mode="dita2html.topic.mode" match="*">
+  <xsl:message>
+    <xsl:text>Unmatched element: </xsl:text>
+    <xsl:value-of select="local-name(.)"/>
+  </xsl:message>
+  <xsl:apply-templates mode="dita2html.topic.mode"/>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/xslt/dita/html/dita2xhtml.xsl b/xslt/dita/html/dita2xhtml.xsl
new file mode 100644
index 0000000..be81da0
--- /dev/null
+++ b/xslt/dita/html/dita2xhtml.xsl
@@ -0,0 +1,83 @@
+<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
+<!--
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your option) any
+later version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this program; see the file COPYING.LGPL.  If not, write to the
+Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA.
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+                xmlns="http://www.w3.org/1999/xhtml";
+                version="1.0">
+
+
+<!--!!==========================================================================
+DITA to XHTML
+
+REMARK: Describe this module
+-->
+
+<xsl:import href="../../common/l10n.xsl"/>
+<xsl:import href="../../common/color.xsl"/>
+<xsl:import href="../../common/icons.xsl"/>
+<xsl:import href="../../common/html.xsl"/>
+<xsl:import href="../../common/ttml.xsl"/>
+<xsl:import href="../../common/utils.xsl"/>
+
+<!--
+<xsl:import href="../common/mal-gloss.xsl"/>
+<xsl:import href="../common/mal-if.xsl"/>
+<xsl:import href="../common/mal-link.xsl"/>
+-->
+
+<!--
+<xsl:param name="mal.if.target" select="'target:html target:xhtml'"/>
+<xsl:param name="mal.if.features" select="'
+mallard:1.0
+'"/>
+<xsl:param name="mal.if.maybe" select="'target:mobile'"/>
+<xsl:param name="mal.link.extension" select="$html.extension"/>
+<xsl:param name="ttml.features" select="'
+http://www.w3.org/ns/ttml/feature/#content
+http://www.w3.org/ns/ttml/feature/#core
+http://www.w3.org/ns/ttml/feature/#nested-div
+http://www.w3.org/ns/ttml/feature/#nested-span
+http://www.w3.org/ns/ttml/feature/#presentation
+http://www.w3.org/ns/ttml/feature/#profile
+http://www.w3.org/ns/ttml/feature/#structure
+http://www.w3.org/ns/ttml/feature/#time-offset
+http://www.w3.org/ns/ttml/feature/#timing
+'"/>
+-->
+
+<xsl:include href="dita2html-block.xsl"/>
+<xsl:include href="dita2html-inline.xsl"/>
+<xsl:include href="dita2html-list.xsl"/>
+<xsl:include href="dita2html-topic.xsl"/>
+<!--
+<xsl:include href="mal2html-api.xsl"/>
+<xsl:include href="mal2html-block.xsl"/>
+<xsl:include href="mal2html-facets.xsl"/>
+<xsl:include href="mal2html-gloss.xsl"/>
+<xsl:include href="mal2html-inline.xsl"/>
+<xsl:include href="mal2html-links.xsl"/>
+<xsl:include href="mal2html-list.xsl"/>
+<xsl:include href="mal2html-media.xsl"/>
+<xsl:include href="mal2html-page.xsl"/>
+<xsl:include href="mal2html-svg.xsl"/>
+<xsl:include href="mal2html-table.xsl"/>
+<xsl:include href="mal2html-ui.xsl"/>
+-->
+
+
+</xsl:stylesheet>
diff --git a/xslt/dita/html/selectors.mod b/xslt/dita/html/selectors.mod
new file mode 100644
index 0000000..b1fd50c
--- /dev/null
+++ b/xslt/dita/html/selectors.mod
@@ -0,0 +1,226 @@
+<!--
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your option) any
+later version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this program; see the file COPYING.LGPL.  If not, write to the
+Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA.
+-->
+
+<!--
+This file contains a set of selectors for DITA content. The selectors reflect
+the level of granularity that is implemented by the yelp-xsl stylesheets, and
+may not be suitable for other uses. The selectors match on element names as
+well as class attributes, so they will work with or without DTDs (although
+specializations not covered here of course require DTDs). The selectors are
+all of the form *[predicate]. This allows axes to be prepended and predicates
+to be appended. They are always named according to the domain of their most
+base element and the local name of their most specialized element. They are
+grouped according to their most base element.
+-->
+
+<!-- ===========================================================================
+topic/body
+-->
+<!ENTITY topic_body "*[
+  name(.) = 'body' or name(.) = 'conbody' or name(.) = 'taskbody' or
+  starts-with(@class, '- topic/body ')
+  ]">
+<!ENTITY topic_body_all "*[
+  name(.) = 'body' or name(.) = 'conbody' or name(.) = 'taskbody' or
+  starts-with(@class, '- topic/body ')
+  ]">
+
+<!-- ===========================================================================
+topic/desc
+-->
+<!ENTITY topic_desc "*[name(.) = 'desc' or starts-with(@class, '- topic/desc ')]">
+
+<!-- ===========================================================================
+topic/itemgroup
+-->
+<!ENTITY topic_info "*[
+  name(.) = 'info' or starts-with(@class, '- topic/itemgroup task/info ')]">
+<!ENTITY topic_stepresult "*[
+  name(.) = 'stepresult' or starts-with(@class, '- topic/itemgroup task/stepresult ')]">
+<!ENTITY topic_stepxmp "*[
+  name(.) = 'stepxmp' or starts-with(@class, '- topic/itemgroup task/stepxmp ')]">
+<!ENTITY topic_tutorialinfo "*[
+  name(.) = 'tutorialinfo' or starts-with(@class, '- topic/itemgroup task/tutorialinfo ')]">
+
+<!-- ===========================================================================
+topic/keyword
+-->
+<!ENTITY topic_cmdname "*[
+  name(.) = 'cmdname' or starts-with(@class, '- topic/keyword sw-d/cmdname ')]">
+<!ENTITY topic_varname "*[
+  name(.) = 'varname' or starts-with(@class, '- topic/keyword sw-d/varname ')]">
+
+<!-- ===========================================================================
+topic/li
+-->
+<!ENTITY topic_step "*[
+  name(.) = 'step' or starts-with(@class, '- topic/li task/step ')]">
+<!ENTITY topic_stepsection "*[
+  name(.) = 'stepsection' or starts-with(@class, '- topic/li task/stepsection ')]">
+<!ENTITY topic_substep "*[
+  name(.) = 'substep' or starts-with(@class, '- topic/li task/substep ')]">
+<!ENTITY topic_li "*[
+name(.) = 'li' or (
+  starts-with(@class, '- topic/li ')
+  and not(starts-with(@class, '- topic/li task/step '))
+  and not(starts-with(@class, '- topic/li task/stepsection '))
+  and not(starts-with(@class, '- topic/li task/substep '))
+  )]">
+<!ENTITY topic_li_all "*[
+  name(.) = 'li' or name(.) = 'step' or name(.) = 'stepsection' or name(.) = 'substep' or
+  starts-with(@class, '- topic/li ')
+  ]">
+
+<!-- ===========================================================================
+topic/link
+-->
+<!ENTITY topic_link "*[name(.) = 'link' or starts-with(@class, '- topic/link ')]">
+
+<!-- ===========================================================================
+topic/linkinfo
+-->
+<!ENTITY topic_linkinfo "*[name(.) = 'linkinfo' or starts-with(@class, '- topic/linkinfo ')]">
+
+<!-- ===========================================================================
+topic/linklist
+-->
+<!ENTITY topic_linklist "*[name(.) = 'linklist' or starts-with(@class, '- topic/linklist ')]">
+
+<!-- ===========================================================================
+topic/linkpool
+-->
+<!ENTITY topic_linkpool "*[name(.) = 'linkpool' or starts-with(@class, '- topic/linkpool ')]">
+
+<!-- ===========================================================================
+topic/linktext
+-->
+<!ENTITY topic_linktext "*[name(.) = 'linktext' or starts-with(@class, '- topic/linktext ')]">
+
+<!-- ===========================================================================
+topic/note
+-->
+<!ENTITY topic_note "*[name(.) = 'note' or starts-with(@class, '- topic/note ')]">
+
+<!-- ===========================================================================
+topic/ol
+-->
+<!ENTITY topic_steps "*[
+  name(.) = 'steps' or starts-with(@class, '- topic/ol task/steps ')]">
+<!ENTITY topic_steps-unordered "*[
+  name(.) = 'steps-unordered' or starts-with(@class, '- topic/ol task/steps-unordered ')]">
+<!ENTITY topic_substeps "*[
+  name(.) = 'substeps' or starts-with(@class, '- topic/ol task/substeps ')]">
+<!ENTITY topic_ol "*[
+  name(.) = 'ol' or (
+  starts-with(@class, '- topic/ol ')
+  and not(starts-with(@class, '- topic/ol task/steps '))
+  and not(starts-with(@class, '- topic/ol task/steps-unordered '))
+  and not(starts-with(@class, '- topic/ol task/substeps '))
+)]">
+<!ENTITY topic_ol_all "*[
+  name(.) = 'ol' or name(.) = 'steps' or name(.) = 'steps-unordered' or name(.) = 'substeps' or
+  starts-with(@class, '- topic/ol ')
+  ]">
+
+<!-- ===========================================================================
+topic/p
+-->
+<!ENTITY topic_p "*[name(.) = 'p' or starts-with(@class, '- topic/p ')]">
+
+<!-- ===========================================================================
+topic/ph
+-->
+<!ENTITY topic_cmd "*[
+  name(.) = 'cmd' or starts-with(@class, '- topic/ph task/cmd ')]">
+<!ENTITY topic_codeph "*[
+  name(.) = 'codeph' or starts-with(@class, '- topic/ph pr-d/codeph ')]">
+<!ENTITY topic_filepath "*[
+  name(.) = 'filepath' or starts-with(@class, '- topic/ph sw-d/filepath ')]">
+<!ENTITY topic_systemoutput "*[
+  name(.) = 'systemoutput' or starts-with(@class, '- topic/ph sw-d/systemoutput ')]">
+<!ENTITY topic_uicontrol "*[
+  name(.) = 'uicontrol' or starts-with(@class, '- topic/ph ui-d/uicontrol ')]">
+<!ENTITY topic_userinput "*[
+  name(.) = 'userinput' or starts-with(@class, '- topic/ph sw-d/userinput ')]">
+
+<!-- ===========================================================================
+topic/pre
+-->
+<!ENTITY topic_codeblock "*[
+  name(.) = 'codeblock' or starts-with(@class, '- topic/pre pr-d/codeblock ')]">
+
+<!-- ===========================================================================
+topic/prolog
+-->
+<!ENTITY topic_prolog "*[name(.) = 'prolog' or starts-with(@class, '- topic/prolog ')]">
+
+<!-- ===========================================================================
+topic/related-links
+-->
+<!ENTITY topic_related-links "*[name(.) = 'related-links' or starts-with(@class, '- topic/related-links ')]">
+
+<!-- ===========================================================================
+topic/section
+-->
+<!ENTITY topic_context "*[
+  name(.) = 'context' or starts-with(@class, '- topic/section task/context ')]">
+<!ENTITY topic_postreq "*[
+  name(.) = 'postreq' or starts-with(@class, '- topic/section task/postreq ')]">
+<!ENTITY topic_prereq  "*[
+  name(.) = 'prereq'  or starts-with(@class, '- topic/section task/prereq ')]">
+<!ENTITY topic_result  "*[
+  name(.) = 'result'  or starts-with(@class, '- topic/section task/result ')]">
+<!ENTITY topic_section "*[
+  name(.) = 'section'  or (
+  starts-with(@class, '- topic/section ')
+  and not(starts-with(@class, '- topic/section task/context '))
+  and not(starts-with(@class, '- topic/section task/postreq '))
+  and not(starts-with(@class, '- topic/section task/prereq '))
+  and not(starts-with(@class, '- topic/section task/result '))
+  )]">
+<!ENTITY topic_section_all "*[
+  name(.) = 'section' or name(.) = 'context' or name(.) = 'prereq' or
+  name(.) = 'postreq' or name(.) = 'result'  or
+  starts-with(@class, '- topic/section ')
+  ]">
+
+<!-- ===========================================================================
+topic/shortdesc
+-->
+<!ENTITY topic_shortdesc "*[name(.) = 'shortdesc' or starts-with(@class, '- topic/shortdesc ')]">
+
+<!-- ===========================================================================
+topic/title
+-->
+<!ENTITY topic_title "*[name(.) = 'title' or starts-with(@class, '- topic/title ')]">
+
+<!-- ===========================================================================
+topic/topic
+-->
+<!ENTITY topic_topic "*[
+  name(.) = 'topic' or name(.) = 'concept' or name(.) = 'task' or
+  starts-with(@class, '- topic/topic ')
+  ]">
+<!ENTITY topic_topic_all "*[
+  name(.) = 'topic' or name(.) = 'concept' or name(.) = 'task' or
+  starts-with(@class, '- topic/topic ')
+  ]">
+
+<!-- ===========================================================================
+topic/ul
+-->
+<!ENTITY topic_ul "*[name(.) = 'ul' or starts-with(@class, '- topic/ul ')]">



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]