Here's an alternate solution to the relativepath issue. Instead of using a global variable in common.xsl, the relativepath variable is defined in each of the main pages, eg. manualpage, modulesynopsis, etc. and it is then passed down through each of the sub templates. Using this method over the one submitted yesterday allows us to created deeper nested directories in the manual directory, instead of being limited to just two (the root directory, and one below it). It also allows us to keep the single style task in build.xml.
Shane
Index: common.xsl =================================================================== RCS file: /home/cvspublic/httpd-2.0/docs/manual/style/common.xsl,v retrieving revision 1.13 diff -u -r1.13 common.xsl --- common.xsl 1 Aug 2002 21:39:48 -0000 1.13 +++ common.xsl 24 Aug 2002 09:05:06 -0000 @@ -12,32 +12,32 @@ <xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'" /> <xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" /> - <xsl:variable name="path"> - <xsl:choose> - <xsl:when test="*/relativepath/@href"> - <xsl:value-of select="*/relativepath/@href"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="'..'"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <!-- --> <!-- Builds the moduleindex page --> <!-- --> <xsl:template match="moduleindex"> + <xsl:variable name="path"> + <xsl:value-of select="'..'"/> + </xsl:variable> + <html> - <xsl:call-template name="head"/> + <xsl:call-template name="head"> + <xsl:with-param name="path" select="$path" /> + </xsl:call-template> + <body> <blockquote> - <xsl:call-template name="top"/> + <xsl:call-template name="top"> + <xsl:with-param name="path" select="$path" /> + </xsl:call-template> <h1 align="center"> <xsl:value-of select="title"/> </h1> - <xsl:apply-templates select="summary" /> + <xsl:apply-templates select="summary"> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> <h2> <xsl:value-of select="$messages/[EMAIL PROTECTED]'corefeatures']"/> @@ -54,7 +54,9 @@ </a> </dt> <dd> - <xsl:apply-templates select="description"/> + <xsl:apply-templates select="description"> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </dd> </xsl:if> </xsl:for-each> @@ -75,14 +77,18 @@ </a> </dt> <dd> - <xsl:apply-templates select="description"/> + <xsl:apply-templates select="description"> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </dd> </xsl:if> </xsl:for-each> </dl> </blockquote> <hr /> - <xsl:call-template name="bottom"/> + <xsl:call-template name="bottom"> + <xsl:with-param name="path" select="$path" /> + </xsl:call-template> </body> </html> </xsl:template> @@ -95,16 +101,26 @@ <!-- Builds the directive index page --> <!-- --> <xsl:template match="directiveindex"> + <xsl:variable name="path"> + <xsl:value-of select="'..'"/> + </xsl:variable> + <html> - <xsl:call-template name="head"/> + <xsl:call-template name="head"> + <xsl:with-param name="path" select="$path" /> + </xsl:call-template> <body> <blockquote> - <xsl:call-template name="top"/> + <xsl:call-template name="top"> + <xsl:with-param name="path" select="$path" /> + </xsl:call-template> <h1 align="center"> <xsl:value-of select="title"/> </h1> - <xsl:apply-templates select="summary" /> + <xsl:apply-templates select="summary"> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> <ul> <xsl:for-each select="document(modulefilelist/modulefile)/modulesynopsis/directivesynopsis"> @@ -121,7 +137,9 @@ </ul> </blockquote> <hr /> - <xsl:call-template name="bottom"/> + <xsl:call-template name="bottom"> + <xsl:with-param name="path" select="$path" /> + </xsl:call-template> </body> </html> </xsl:template> @@ -132,20 +150,32 @@ <!-- Process an entire document into an HTML page --> <!-- --> <xsl:template match="manualpage"> + <xsl:variable name="path"> + <xsl:value-of select="//manualpage/relativepath/@href"/> + </xsl:variable> + <html> - <xsl:call-template name="head"/> + <xsl:call-template name="head"> + <xsl:with-param name="path" select="$path" /> + </xsl:call-template> <body> <blockquote> - <xsl:call-template name="top"/> + <xsl:call-template name="top"> + <xsl:with-param name="path" select="$path" /> + </xsl:call-template> <h1 align="center"> <xsl:value-of select="title"/> </h1> - <xsl:apply-templates select="summary"/> + <xsl:apply-templates select="summary"> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> <xsl:if test="count(section) > 1"> <ul> - <xsl:apply-templates select="section" mode="index"/> + <xsl:apply-templates select="section" mode="index"> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </ul> </xsl:if> <hr /> @@ -160,16 +190,22 @@ <ul> <xsl:for-each select="seealso"> <li> - <xsl:apply-templates/> + <xsl:apply-templates> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </li> </xsl:for-each> </ul> </xsl:if> - <xsl:apply-templates select="section"/> + <xsl:apply-templates select="section"> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> <hr /> </blockquote> - <xsl:call-template name="bottom"/> + <xsl:call-template name="bottom"> + <xsl:with-param name="path" select="$path" /> + </xsl:call-template> </body> </html> </xsl:template> @@ -182,11 +218,19 @@ <!-- Process an entire document into an HTML page --> <!-- --> <xsl:template match="modulesynopsis"> + <xsl:variable name="path"> + <xsl:value-of select="'..'"/> + </xsl:variable> + <html> - <xsl:call-template name="head"/> + <xsl:call-template name="head"> + <xsl:with-param name="path" select="$path" /> + </xsl:call-template> <body> <blockquote> - <xsl:call-template name="top"/> + <xsl:call-template name="top"> + <xsl:with-param name="path" select="$path" /> + </xsl:call-template> <h1 align="center"> <xsl:value-of select="$messages/[EMAIL PROTECTED]'apachemodule']"/> <xsl:text> </xsl:text> @@ -205,7 +249,9 @@ </span> </td> <td> - <xsl:apply-templates select="description"/> + <xsl:apply-templates select="description"> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </td> </tr> @@ -241,7 +287,9 @@ </a> </td> <td> - <xsl:apply-templates select="compatibility"/> + <xsl:apply-templates select="compatibility"> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </td> </tr> </xsl:if> @@ -256,7 +304,9 @@ <xsl:value-of select="$messages/[EMAIL PROTECTED]'summary']"/> </h2> - <xsl:apply-templates select="summary"/> + <xsl:apply-templates select="summary"> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </xsl:if> <!-- Index of directives, automatically generated from @@ -317,22 +367,29 @@ <ul> <xsl:for-each select="seealso"> <li> - <xsl:apply-templates/> + <xsl:apply-templates> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </li> </xsl:for-each> </ul> </xsl:if> <!-- Sections of documentation about the module as a whole --> - <xsl:apply-templates select="section"/> + <xsl:apply-templates select="section"> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> <hr /> <!-- Directive documentation --> <xsl:apply-templates select="directivesynopsis"> + <xsl:with-param name="path" select="$path" /> <xsl:sort select="name"/> </xsl:apply-templates> </blockquote> - <xsl:call-template name="bottom"/> + <xsl:call-template name="bottom"> + <xsl:with-param name="path" select="$path" /> + </xsl:call-template> </body> </html> </xsl:template> @@ -344,6 +401,8 @@ <!-- --> <xsl:template name="head"> + <xsl:param name="path" /> + <head> <xsl:comment> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX @@ -368,6 +427,8 @@ </xsl:template> <xsl:template name="top"> + <xsl:param name="path" /> + <div align="center"> <img src="{$path}/images/sub.gif"> <xsl:attribute name="alt"> @@ -382,6 +443,8 @@ </xsl:template> <xsl:template name="bottom"> + <xsl:param name="path" /> + <h3 align="center"> <xsl:value-of select="$messages/[EMAIL PROTECTED]'apachehttpserver']"/> </h3> @@ -409,6 +472,8 @@ <!-- Subsections: get a lower level heading --> <xsl:template match="section/section"> + <xsl:param name="path" /> + <xsl:variable name="href"> <xsl:value-of select="@id"/> </xsl:variable> @@ -417,25 +482,33 @@ <xsl:if test="@id"> <h3> <a name="{$href}"> - <xsl:apply-templates select="./title" mode="print"/> + <xsl:apply-templates select="./title" mode="print"> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </a> </h3> </xsl:if> <xsl:if test="not(@id)"> <h3> - <xsl:apply-templates select="./title" mode="print"/> + <xsl:apply-templates select="./title" mode="print"> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </h3> </xsl:if> <!-- Section body --> - <xsl:apply-templates/> + <xsl:apply-templates> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </xsl:template> <!-- Process a documentation section --> <xsl:template match="section"> + <xsl:param name="path" /> + <xsl:variable name="href"> <xsl:value-of select="@id"/> </xsl:variable> @@ -444,25 +517,35 @@ <xsl:if test="@id"> <h2> <a name="{$href}"> - <xsl:apply-templates select="./title" mode="print"/> + <xsl:apply-templates select="./title" mode="print"> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </a> </h2> </xsl:if> <xsl:if test="not(@id)"> <h2> - <xsl:apply-templates select="./title" mode="print"/> + <xsl:apply-templates select="./title" mode="print"> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </h2> </xsl:if> <!-- Section body --> - <xsl:apply-templates/> + <xsl:apply-templates> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </xsl:template> <xsl:template match="section/title" mode="print"> - <xsl:apply-templates/> + <xsl:param name="path" /> + + <xsl:apply-templates> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </xsl:template> @@ -474,18 +557,24 @@ <xsl:template match="section" mode="index"> + <xsl:param name="path" /> + <xsl:variable name="href"> <xsl:value-of select="@id"/> </xsl:variable> <li> <a href="#{$href}"> - <xsl:apply-templates select="title" mode="print"/> + <xsl:apply-templates select="title" mode="print"> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </a> <xsl:if test="section"> <ul> - <xsl:apply-templates select="section" mode="index"/> + <xsl:apply-templates select="section" mode="index"> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </ul> </xsl:if> </li> @@ -497,6 +586,8 @@ <xsl:template match="directivesynopsis"> + <xsl:param name="path" /> + <xsl:if test="not(@location)"> <xsl:variable name="name"> <xsl:value-of select="./name"/> @@ -541,7 +632,9 @@ </a> </td> <td> - <xsl:apply-templates select="syntax"/> + <xsl:apply-templates select="syntax"> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </td> </tr> @@ -567,7 +660,9 @@ </a> </td> <td> - <xsl:apply-templates select="contextlist"/> + <xsl:apply-templates select="contextlist"> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </td> </tr> @@ -603,7 +698,9 @@ </td> <td> <xsl:if test="modulelist"> - <xsl:apply-templates select="modulelist"/> + <xsl:apply-templates select="modulelist"> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </xsl:if> <xsl:if test="not(modulelist)"> @@ -629,7 +726,9 @@ </tr> </table> - <xsl:apply-templates select="usage"/> + <xsl:apply-templates select="usage"> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> <xsl:if test="seealso"> <p> @@ -641,7 +740,9 @@ <ul> <xsl:for-each select="seealso"> <li> - <xsl:apply-templates/> + <xsl:apply-templates> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </li> </xsl:for-each> </ul> @@ -659,7 +760,11 @@ <!-- Passes through content --> <!-- --> <xsl:template match="contextlist"> - <xsl:apply-templates select="context"/> + <xsl:param name="path" /> + + <xsl:apply-templates select="context"> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </xsl:template> <!-- /contextlist --> @@ -682,8 +787,12 @@ <!-- Passes through content --> <!-- --> <xsl:template match="modulelist"> + <xsl:param name="path" /> + <xsl:for-each select="module"> - <xsl:call-template name="module"/> + <xsl:call-template name="module"> + <xsl:with-param name="path" select="$path" /> + </xsl:call-template> <xsl:if test="not(position()=last())">, </xsl:if> </xsl:for-each> </xsl:template> @@ -695,14 +804,20 @@ <!-- Examples are set in a "colored" table. --> <!-- --> <xsl:template match="example"> + <xsl:param name="path" /> + <blockquote> <table cellpadding="10"> <tr> <td bgcolor="#eeeeee"> - <xsl:apply-templates select="title" mode="print"/> + <xsl:apply-templates select="title" mode="print"> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> <code> - <xsl:apply-templates/> + <xsl:apply-templates> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </code> </td> </tr> @@ -717,9 +832,13 @@ <!-- <example><title> --> <!-- --> <xsl:template match="example/title" mode="print"> + <xsl:param name="path" /> + <p align="center"> <strong> - <xsl:apply-templates/> + <xsl:apply-templates> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </strong> </p> </xsl:template> @@ -742,6 +861,8 @@ <!-- ground colors, depending on type of note. --> <!-- --> <xsl:template match="note"> + <xsl:param name="path" /> + <blockquote> <table> <tr> @@ -755,7 +876,9 @@ </xsl:otherwise> </xsl:choose> - <xsl:apply-templates/> + <xsl:apply-templates> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </td> </tr> </table> @@ -769,9 +892,13 @@ <!-- <note><title> --> <!-- --> <xsl:template match="note/title"> + <xsl:param name="path" /> + <p align="center"> <strong> - <xsl:apply-templates/> + <xsl:apply-templates> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </strong> </p> </xsl:template> @@ -786,6 +913,8 @@ <!-- lower case. --> <!-- --> <xsl:template match="directive" name="directive"> + <xsl:param name="path" /> + <xsl:if test="@module"> <xsl:variable name="module"> <xsl:value-of select="./@module"/> @@ -836,6 +965,8 @@ <!-- Inserts a link to refereed module --> <!-- --> <xsl:template match="module" name="module"> + <xsl:param name="path" /> + <code> <a href="{$path}/mod/{.}.html"> <xsl:value-of select="."/> @@ -850,6 +981,8 @@ <!-- <related> --> <!-- --> <xsl:template match="related"> + <xsl:param name="path" /> + <table border="1"> <tr> <td valign="top"> @@ -859,7 +992,9 @@ <br /> <br /> - <xsl:apply-templates select="modulelist"/> + <xsl:apply-templates select="modulelist"> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </td> <td valign="top"> <strong> @@ -868,7 +1003,9 @@ <br /> <br /> - <xsl:apply-templates select="directivelist"/> + <xsl:apply-templates select="directivelist"> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </td> </tr> </table> @@ -878,8 +1015,12 @@ <xsl:template match="related/modulelist"> + <xsl:param name="path" /> + <xsl:for-each select="module"> - <xsl:call-template name="module"/> + <xsl:call-template name="module"> + <xsl:with-param name="path" select="$path" /> + </xsl:call-template> <br /> </xsl:for-each> </xsl:template> @@ -887,8 +1028,12 @@ <xsl:template match="related/directivelist"> + <xsl:param name="path" /> + <xsl:for-each select="directive"> - <xsl:call-template name="directive"/> + <xsl:call-template name="directive"> + <xsl:with-param name="path" select="$path" /> + </xsl:call-template> <br /> </xsl:for-each> </xsl:template> @@ -900,7 +1045,11 @@ <!-- Passes through content --> <!-- --> <xsl:template match="summary"> - <xsl:apply-templates/> + <xsl:param name="path" /> + + <xsl:apply-templates> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </xsl:template> <!-- /summary --> @@ -911,7 +1060,11 @@ <!-- Passes through content --> <!-- --> <xsl:template match="description"> - <xsl:apply-templates/> + <xsl:param name="path" /> + + <xsl:apply-templates> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </xsl:template> <!-- /description --> @@ -922,7 +1075,11 @@ <!-- Passes through content --> <!-- --> <xsl:template match="usage"> - <xsl:apply-templates/> + <xsl:param name="path" /> + + <xsl:apply-templates> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </xsl:template> <!-- /usage --> @@ -933,7 +1090,11 @@ <!-- Passes through content --> <!-- --> <xsl:template match="syntax"> - <xsl:apply-templates/> + <xsl:param name="path" /> + + <xsl:apply-templates> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </xsl:template> <!-- /syntax --> @@ -943,8 +1104,12 @@ <!-- Process everything else by just passing it through --> <!-- --> <xsl:template match="*|@*"> + <xsl:param name="path" /> + <xsl:copy> - <xsl:apply-templates select="@*|*|text()"/> + <xsl:apply-templates select="@*|*|text()"> + <xsl:with-param name="path" select="$path" /> + </xsl:apply-templates> </xsl:copy> </xsl:template>
Index: build.xml =================================================================== RCS file: /home/cvspublic/site-tools/httpd-docs-build/build.xml,v retrieving revision 1.6 diff -u -r1.6 build.xml --- build.xml 24 Aug 2002 01:57:02 -0000 1.6 +++ build.xml 24 Aug 2002 09:22:52 -0000 @@ -68,14 +68,6 @@ destdir="../" style="../style/manual.en.xsl"> <mapper type="glob" from="*.xml" to="*.html.en" /> - <depth min="1" max="1" /> - <patternset refid="en-allxml" /> - </style> - - <style basedir="../" - destdir="../" - style="../style/manual.en.xsl"> - <mapper type="glob" from="*.xml" to="*.html.en" /> <patternset refid="en-allxml" /> </style> @@ -84,26 +76,10 @@ destdir="../" style="../style/manual.ja.xsl"> <mapper type="glob" from="*.xml.ja" to="*.html.ja.jis" /> - <depth min="1" max="1" /> - <patternset refid="ja.jis-allxml" /> - </style> - - <style basedir="../" - destdir="../" - style="../style/manual.ja.xsl"> - <mapper type="glob" from="*.xml.ja" to="*.html.ja.jis" /> <patternset refid="ja.jis-allxml" /> </style> - + <!-- Transform all German documents --> - <style basedir="../" - destdir="../" - style="../style/manual.de.xsl"> - <mapper type="glob" from="*.xml.de" to="*.html.de" /> - <depth min="1" max="1" /> - <patternset refid="de-allxml" /> - </style> - <style basedir="../" destdir="../" style="../style/manual.de.xsl">
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]