[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] customization layer for DocBook 5.0: TheTransition Guide
"Michael(tm) Smith" <smith@sideshowbarker.net>, 2007-08-29 14:46 +0900: > To show what sort of changes you need to make in order to modify > an existing customization layer for use with the XSL-NS > stylesheets, I ran a diff between the html.xsl and html-ns.xsl at > the URL above, and have attached that. Sorry, forgot to attach it to my previous message. I've attached it to this one. --Mike -- Michael(tm) Smith http://people.w3.org/mike/ http://sideshowbarker.net/
--- html.xsl 2007-08-29 13:29:03.000000000 +0900
+++ html-ns.xsl 2007-08-29 14:18:12.000000000 +0900
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:d="http://docbook.org/ns/docbook"
+ exclude-result-prefixes="d"
version="1.0">
-<xsl:import href="../../../../../xsl/html/profile-docbook.xsl"/>
+<xsl:import href="http://docbook.sourceforge.net/release/xsl-ns/current/html/profile-docbook.xsl"/>
<xsl:param name="profile.status">final</xsl:param>
@@ -15,34 +17,34 @@
<xsl:template name="article.titlepage">
<div class="titlepage">
- <xsl:apply-templates select="articleinfo" mode="howto-titlepage"/>
+ <xsl:apply-templates select="d:info" mode="howto-titlepage"/>
<hr/>
</div>
</xsl:template>
-<xsl:template match="articleinfo" mode="howto-titlepage">
- <xsl:apply-templates select="title" mode="howto-titlepage"/>
- <xsl:apply-templates select="subtitle" mode="howto-titlepage"/>
- <xsl:apply-templates select="pubdate[1]" mode="howto-titlepage"/>
+<xsl:template match="d:info" mode="howto-titlepage">
+ <xsl:apply-templates select="d:title" mode="howto-titlepage"/>
+ <xsl:apply-templates select="d:subtitle" mode="howto-titlepage"/>
+ <xsl:apply-templates select="d:pubdate[1]" mode="howto-titlepage"/>
<div class="metadata">
- <xsl:apply-templates select="pubdate[1]" mode="version-list"/>
- <xsl:apply-templates select="authorgroup" mode="howto-titlepage"/>
+ <xsl:apply-templates select="d:pubdate[1]" mode="version-list"/>
+ <xsl:apply-templates select="d:authorgroup" mode="howto-titlepage"/>
</div>
</xsl:template>
-<xsl:template match="title" mode="howto-titlepage">
+<xsl:template match="d:title" mode="howto-titlepage">
<h1>
<xsl:apply-templates/>
</h1>
</xsl:template>
-<xsl:template match="subtitle" mode="howto-titlepage">
+<xsl:template match="d:subtitle" mode="howto-titlepage">
<h2>
<xsl:apply-templates/>
</h2>
</xsl:template>
-<xsl:template match="pubdate" mode="howto-titlepage">
+<xsl:template match="d:pubdate" mode="howto-titlepage">
<h3>
<xsl:call-template name="datetime.format">
<xsl:with-param name="date" select="."/>
@@ -51,7 +53,7 @@
</h3>
</xsl:template>
-<xsl:template match="pubdate[1]" priority="10"
+<xsl:template match="d:pubdate[1]" priority="10"
mode="version-list">
<h4>This version:</h4>
<dl class="urilist">
@@ -74,31 +76,31 @@
</dt>
</dl>
- <xsl:if test="following-sibling::pubdate">
+ <xsl:if test="following-sibling::d:pubdate">
<h4>
<xsl:text>Previous version</xsl:text>
- <xsl:if test="count(following-sibling::pubdate) > 1">
+ <xsl:if test="count(following-sibling::d:pubdate) > 1">
<xsl:text>s</xsl:text>
</xsl:if>
<xsl:text>:</xsl:text>
</h4>
<dl class="urilist">
<xsl:apply-templates
- select="following-sibling::pubdate"
+ select="following-sibling::d:pubdate"
mode="version-list"/>
</dl>
</xsl:if>
</xsl:template>
-<xsl:template match="pubdate" mode="version-list">
- <xsl:if test="count(preceding-sibling::pubdate) < 4">
+<xsl:template match="d:pubdate" mode="version-list">
+ <xsl:if test="count(preceding-sibling::d:pubdate) < 4">
<dt>
<xsl:apply-templates select="." mode="datedURI"/>
</dt>
</xsl:if>
</xsl:template>
-<xsl:template match="pubdate" mode="datedURI">
+<xsl:template match="d:pubdate" mode="datedURI">
<xsl:variable name="uri">
<xsl:text>http://docbook.org/docs/howto/</xsl:text>
<xsl:value-of select="substring(.,1,4)"/>
@@ -121,29 +123,28 @@
<xsl:text>)</xsl:text>
</xsl:template>
-<xsl:template match="authorgroup" mode="howto-titlepage">
+<xsl:template match="d:authorgroup" mode="howto-titlepage">
<h4>
<xsl:text>Author</xsl:text>
- <xsl:if test="count(author) > 1">s</xsl:if>
+ <xsl:if test="count(d:author) > 1">s</xsl:if>
<xsl:text>:</xsl:text>
</h4>
<dl class="authorlist">
- <xsl:apply-templates select="author" mode="howto-titlepage"/>
+ <xsl:apply-templates select="d:author" mode="howto-titlepage"/>
</dl>
</xsl:template>
-<xsl:template match="author" mode="howto-titlepage">
+<xsl:template match="d:author" mode="howto-titlepage">
<dt>
- <xsl:apply-templates select="personname"/>
- <xsl:if test="email">
+ <xsl:apply-templates select="d:personname"/>
+ <xsl:if test="d:email">
<xsl:text>, </xsl:text>
- <xsl:apply-templates select="email"/>
+ <xsl:apply-templates select="d:email"/>
</xsl:if>
</dt>
</xsl:template>
-<!-- !!! Namespace stripping will rename db:tag to sgmltag -->
-<xsl:template match="sgmltag[not(@class) or (@class='element')]
+<xsl:template match="d:tag[not(@class) or (@class='element')]
[not(@condition = 'nolink')]">
<xsl:variable name="baseUri">
<xsl:choose>
@@ -160,7 +161,7 @@
</xsl:template>
<!-- Support for labels identifying programlisting syntax used -->
-<xsl:template match="programlisting[@language]">
+<xsl:template match="d:programlisting[@language]">
<xsl:param name="suppress-numbers" select="'0'"/>
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]