]> granicus.if.org Git - docbook-dsssl/commitdiff
Fixed profiling to work with modified chunking code
authorJirka Kosek <jirka@kosek.cz>
Mon, 12 May 2003 16:08:55 +0000 (16:08 +0000)
committerJirka Kosek <jirka@kosek.cz>
Mon, 12 May 2003 16:08:55 +0000 (16:08 +0000)
xsl/html/Makefile
xsl/html/Makefile.param
xsl/html/profile-chunk.xsl [new file with mode: 0644]
xsl/html/profile-onechunk.xsl [new file with mode: 0644]

index adc14863997a73092c58de24edbf4ad95fd6369e..465a49eb452e2e1a2bc15dafdf487391e972e1c1 100644 (file)
@@ -7,7 +7,7 @@ PARAMSTRIP=.param.stripped
 include Makefile.param
 
 all: titlepage.templates.xsl param.xsl \
-     profile-docbook.xsl profile-chunk.xsl profile-onechunk.xsl
+     profile-docbook.xsl profile-chunk-code.xsl
 
 xml: param.xml
 
@@ -40,10 +40,7 @@ Makefile.param:
 profile-docbook.xsl: docbook.xsl ../profiling/xsl2profile.xsl
        $(XSLT) $< ../profiling/xsl2profile.xsl $@
 
-profile-chunk.xsl: chunk.xsl ../profiling/xsl2profile.xsl
-       $(XSLT) $< ../profiling/xsl2profile.xsl $@
-
-profile-onechunk.xsl: onechunk.xsl ../profiling/xsl2profile.xsl
+profile-chunk-code.xsl: chunk-code.xsl ../profiling/xsl2profile.xsl
        $(XSLT) $< ../profiling/xsl2profile.xsl $@
 
 clean:
index ea1e1c5e0840070d9816b216d6eec698bf1e94f3..be2936091506345abd604d35728e4cadaabdbfc0 100644 (file)
@@ -1,6 +1,7 @@
 PARAMS=../params/admon.graphics.xml \
        ../params/admon.graphics.extension.xml \
        ../params/admon.graphics.path.xml \
+       ../params/admon.textlabel.xml \
        ../params/admon.style.xml \
        ../params/annotate.toc.xml \
        ../params/appendix.autolabel.xml \
diff --git a/xsl/html/profile-chunk.xsl b/xsl/html/profile-chunk.xsl
new file mode 100644 (file)
index 0000000..1d3a3db
--- /dev/null
@@ -0,0 +1,28 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:exsl="http://exslt.org/common"
+               version="1.0"
+                exclude-result-prefixes="exsl">
+
+<xsl:import href="docbook.xsl"/>
+<xsl:import href="chunk-common.xsl"/>
+<xsl:include href="manifest.xsl"/>
+
+<!-- Why is chunk-code now xsl:included?
+
+Suppose you want to customize *both* the chunking algorithm used *and* the
+presentation of some elements that may be chunks. In order to do that, you
+must get the order of imports "just right". The answer is to make your own
+copy of this file, where you replace the initial import of "docbook.xsl"
+with an import of your own base.xsl (that does its own import of docbook.xsl).
+
+Put the templates for changing the presentation of elements in your base.xsl.
+
+Put the templates that control chunking after the include of chunk-code.xsl.
+
+Voila! (Man I hope we can do this better in XSLT 2.0)
+
+-->
+
+<xsl:include href="profile-chunk-code.xsl"/>
+
+</xsl:stylesheet>
diff --git a/xsl/html/profile-onechunk.xsl b/xsl/html/profile-onechunk.xsl
new file mode 100644 (file)
index 0000000..9bcd74f
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
+                version="1.0"
+                exclude-result-prefixes="doc">
+
+<xsl:import href="profile-chunk.xsl"/>
+
+<!-- Ok, using the onechunk parameter makes this all work again. -->
+<!-- It does have the disadvantage that it only works for documents that have -->
+<!-- a root element that is considered a chunk by the chunk.xsl stylesheet. -->
+<!-- Ideally, onechunk would let anything be a chunk. But not today. -->
+
+<xsl:param name="onechunk" select="1"/>
+
+<xsl:template name="href.target.uri">
+  <xsl:param name="object" select="."/>
+  <xsl:text>#</xsl:text>
+  <xsl:call-template name="object.id">
+    <xsl:with-param name="object" select="$object"/>
+  </xsl:call-template>
+</xsl:template>
+
+</xsl:stylesheet>