[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Subject: Re: DOCBOOK-APPS: Customizing DocBook to Produce a real URL Tree
Am Dienstag, 26. November 2002 11:41 schrieb Shlomi Fish: > Hi! > > I'm not happily using the db2* tools to convert DocBook/XML into > various formats. However, I noticed that jade put all the HTML file > into one directory and calls them with obscure names such as: > > book1.html > c16.html > x208.html > > etc. Now what I want is that it will be real URL Tree: > > (Root) > [id1] > [id1]/[id2] > [id1]/[id2]/[id3] > [id4] you need to customize <xsl:template match="*" mode="chunk-filename"> its inside chunk-common i believe. I dont know how to customize DSSSL. I use xinclude to put my docbook together and then i have all these nice xml:base attributes. i modified it like this (its not working code because of some missing templates ('getdir' and 'has.chunk.children', but i can easily send you a working example if its not enough and you are interested. (if you dont work with xinclude you can write a recursive template which goes up and builds a diretory path from ancestor ids. i made it like this before i used xinclude) <xsl:template match="*" mode="chunk-filename"> <xsl:variable name="ischunk"><xsl:call-template name="chunk"/></xsl:variable> <xsl:choose> <xsl:when test="$ischunk='0'"> <xsl:choose> <xsl:when test="count(parent::*)>0"> <xsl:apply-templates mode="chunk-filename" select="parent::*"/> </xsl:when> <!-- unless there is no up, in which case return "" --> <xsl:otherwise></xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:variable name="xmlbase" select="ancestor-or-self::*[@xml:base][1]/@xml:base"/> <xsl:variable name="mydir"> <xsl:call-template name="getdir"> <xsl:with-param name="filename" select="$xmlbase"/> </xsl:call-template> </xsl:variable> <xsl:variable name="myid"> <xsl:call-template name="object.id"/> </xsl:variable> <xsl:variable name="has.chunk.children"> <xsl:call-template name="has.chunk.children"/> </xsl:variable> <xsl:choose> <xsl:when test="$has.chunk.children = '1'"> <xsl:value-of select="$mydir"/> <xsl:value-of select="concat($root.filename, $html.ext)"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$mydir"/> <xsl:value-of select="concat($myid, $html.ext)"/> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:template> -- PLANWERK 6 /websolutions Herzogstraße 85 40215 Düsseldorf fon 0211-6015919 fax 0211-6015917 http://www.planwerk6.de
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Powered by eList eXpress LLC