OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: HTML Output using folders


Dear all,
I want to add some comments on this message "Chunked output with .css and
images folder" which has been posted here some while ago.
http://lists.oasis-open.org/archives/docbook-apps/200305/msg00002.html

Chunking the HTML files in a hierachical folder structure was one of the
things I had to realize in my recent project and I worked out a pragmatic
solution using the exsl features of XSLTproc. Please let me know what you
think.

At first some information:
- XSLTPROC
- Chunking on section level using <?dbhtml dir="xy"?>.
- Folder structure:
	root
		/images
		/css
		/scripts
		/files
			/subdir1
			/subdir2
				/subsubdir


I had to customize all templates with generate references to the file system
(images, admons, css, scripts).
Cross-references still work fine.

Here some (not all) of my customizations to make chunking in folders work:
<!-- 
  returns the path to root dir e.g. ../../ 
-->
<xsl:template name="pathtorootdir">
	<xsl:variable name="dir">
      	<xsl:call-template name="dbhtml-dir">
            	<xsl:with-param name="context" select="."/>
		</xsl:call-template>
	</xsl:variable>
	<xsl:variable name="token" select="str:tokenize($dir, '/')"/>
	<xsl:for-each select="$token">
		<xsl:text>../</xsl:text>
	</xsl:for-each>
</xsl:template>

<xsl:template name="admon.graphic">
*snip*
	<xsl:variable name="pathtorootdir">
		<xsl:call-template name="pathtorootdir"/>
	</xsl:variable>
	<xsl:param name="node" select="."/>
		<xsl:value-of select="concat($pathtorootdir,
$admon.graphics.path)"/>
	<xsl:choose>
*snap*

<xsl:template name="callout-bug">
	<xsl:variable name="pathtorootdir">
		<xsl:call-template name="pathtorootdir"/>
	</xsl:variable>
*snip*
                <img
src="{$pathtorootdir}{$callout.graphics.path}{$conum}{$callout.graphics.exte
nsion}" alt="{$conum}" border="0"/>
*snap*

<xsl:template name="user.head.content">
	<xsl:variable name="pathtorootdir">
		<xsl:call-template name="pathtorootdir"/>
	</xsl:variable>
*snip*
	<link rel="stylesheet" type="text/css">
		<xsl:attribute name="href">
			<xsl:value-of select="concat($pathtorootdir,
$html.stylesheet.cstm)"/>
		</xsl:attribute>
	</link>
*snap*


Best wishes.
Ludger Thomas

smime.p7s



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]