crossley 02/01/14 21:09:51 Modified: src/documentation sitemap.xmap src/documentation/xdocs book.xml src/documentation/stylesheets doclist.xsl doclist2document.xsl Log: Finalised the "List of Docs" functionality to automatically generate a list of all documentation. Revision Changes Path 1.2 +3 -4 xml-cocoon2/src/documentation/sitemap.xmap Index: sitemap.xmap =================================================================== RCS file: /home/cvs/xml-cocoon2/src/documentation/sitemap.xmap,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- sitemap.xmap 3 Jan 2002 12:30:59 -0000 1.1 +++ sitemap.xmap 15 Jan 2002 05:09:51 -0000 1.2 @@ -92,16 +92,15 @@ <map:serialize/> </map:match> - <!-- Generate the Table of Contents - The first match generates each book.xml and adds a new element "path". + <!-- Generate the "doclist" - list of all documentation + The first match generates each book.xml and adds a new attribute "uri". The second match aggregates each book.xml into a doclist and then converts it to a document. --> <map:match pattern="doclist/xdocs/**book.xml"> <map:generate src="xdocs/{1}book.xml"/> <map:transform src="stylesheets/doclist.xsl"> - <map:parameter name="use-request-parameters" value="true"/> - <map:parameter name="path" value="{1}"/> + <map:parameter name="uri" value="{1}"/> </map:transform> <map:serialize type="xml"/> </map:match> 1.2 +1 -1 xml-cocoon2/src/documentation/xdocs/book.xml Index: book.xml =================================================================== RCS file: /home/cvs/xml-cocoon2/src/documentation/xdocs/book.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- book.xml 3 Jan 2002 12:31:01 -0000 1.1 +++ book.xml 15 Jan 2002 05:09:51 -0000 1.2 @@ -25,7 +25,7 @@ </menu> <menu label="Infos"> -<!-- <menu-item label="List of Docs" href="doclist.html"/> --> + <menu-item label="List of Docs" href="doclist.html"/> <menu-item label="Who we are" href="who.html"/> <menu-item label="Contributing" href="contrib.html"/> <menu-item label="3rd Party" href="3rdparty.html"/> 1.2 +3 -6 xml-cocoon2/src/documentation/stylesheets/doclist.xsl Index: doclist.xsl =================================================================== RCS file: /home/cvs/xml-cocoon2/src/documentation/stylesheets/doclist.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- doclist.xsl 3 Jan 2002 12:31:01 -0000 1.1 +++ doclist.xsl 15 Jan 2002 05:09:51 -0000 1.2 @@ -4,14 +4,11 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> - <xsl:import href="copyover.xsl"/> - - <xsl:param name="path"/> + <xsl:param name="uri"/> <xsl:template match="book"> - <book title="{@title}"> - <path><xsl:value-of select="$path"/></path> - <xsl:apply-templates/> + <book title="{@title}" uri="{$uri}"> + <xsl:copy-of select="node()"/> </book> </xsl:template> 1.2 +22 -9 xml-cocoon2/src/documentation/stylesheets/doclist2document.xsl Index: doclist2document.xsl =================================================================== RCS file: /home/cvs/xml-cocoon2/src/documentation/stylesheets/doclist2document.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- doclist2document.xsl 3 Jan 2002 12:31:01 -0000 1.1 +++ doclist2document.xsl 15 Jan 2002 05:09:51 -0000 1.2 @@ -10,10 +10,12 @@ <title>List of all documentation</title> </header> <body> - <s1 title="Table of Contents"> + <s1 title="Documentation List"> <p> This complete list shows, at a glance, how all of the documentation - fits together within a hierarchy of sections. + fits together within the hierarchy of sections. +<!-- For an overview of the documentation see the new + "Table of Contents". --> </p> <p> The side-panel of each actual document is used to reach other documents @@ -36,36 +38,47 @@ </s1> </xsl:template> - <xsl:template match="path"/> - <xsl:template match="menu"> <xsl:if test="@label!='Navigation'"> <p><strong><xsl:value-of select="@label"/></strong></p> <ul> <xsl:apply-templates> - <xsl:with-param name="path" select="../path"/> + <xsl:with-param name="uri" select="../@uri"/> </xsl:apply-templates> </ul> </xsl:if> </xsl:template> <xsl:template match="menu-item"> - <xsl:param name="path"/> + <xsl:param name="uri"/> <xsl:if test="not(@type) or @type!='hidden'"> <xsl:if test="@label!='Main' and @label!='User Documentation'"> <!-- FIXME: ensure href is not full URL scheme:// --> - <li><link href="{$path}{@href}"><xsl:value-of select="@label"/></link> <!-- - (path=<xsl:value-of select="$path"/> href=<xsl:value-of select="@href"/>) + (uri=<xsl:value-of select="$uri"/> href=<xsl:value-of select="@href"/>) --> + <li><link href="{$uri}{@href}"><xsl:value-of select="@label"/></link> </li> </xsl:if> </xsl:if> </xsl:template> <xsl:template match="external"> + <xsl:param name="uri"/> <xsl:if test="not(@type) or @type!='hidden'"> - <li><link href="{@href}"><xsl:value-of select="@label"/></link></li> + <xsl:choose> + <!-- FIXME: specially handle menu item "API (Javadoc)", it causes a bug. --> + <xsl:when test="starts-with(@label,'API')"> + <li><link href="http://xml.apache.org/cocoon/apidocs/"><xsl:value-of select="@label"/></link></li> +<!-- FIXME: here is the bug: + <li><link href="{@href}"><xsl:value-of select="@label"/></link></li> + <li><xsl:value-of select="@label"/>href=<xsl:value-of select="@href"/></li> +--> + </xsl:when> + <xsl:otherwise> + <li><link href="{@href}"><xsl:value-of select="@label"/></link></li> + </xsl:otherwise> + </xsl:choose> </xsl:if> </xsl:template>
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]