cvs: php-gtk /docs/stylesheets/xsl chunk-filename.xsl html.xsl.in /docs/stylesheets/xsl/html chunk-common.xsl chunk.xsl

From: Date: Sun, 18 Mar 2001 14:59:56 +0000
Subject: cvs: php-gtk /docs/stylesheets/xsl chunk-filename.xsl html.xsl.in /docs/stylesheets/xsl/html chunk-common.xsl chunk.xsl
Groups: php.gtk 
Request: Send a blank email to php-gtk+get-979@lists.php.net to get a copy of this message
jmoore Sun Mar 18 06:59:56 2001 EDT Added files: /php-gtk/docs/stylesheets/xsl/html chunk-common.xsl chunk.xsl Removed files: /php-gtk/docs/stylesheets/xsl chunk-filename.xsl Modified files: /php-gtk/docs/stylesheets/xsl html.xsl.in Log: Begin to chunk the classentries

Index: php-gtk/docs/stylesheets/xsl/html.xsl.in diff -u php-gtk/docs/stylesheets/xsl/html.xsl.in:1.1 php-gtk/docs/stylesheets/xsl/html.xsl.in:1.2 --- php-gtk/docs/stylesheets/xsl/html.xsl.in:1.1 Wed Mar 14 10:31:53 2001 +++ php-gtk/docs/stylesheets/xsl/html.xsl.in Sun Mar 18 06:59:56 2001 @@ -2,7 +2,7 @@ HTML specific stylesheet - $Id: html.xsl.in,v 1.1 2001/03/14 18:31:53 jmoore Exp $ + $Id: html.xsl.in,v 1.2 2001/03/18 14:59:56 jmoore Exp $ --> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" @@ -10,7 +10,7 @@ version="1.0"> <xsl:import href="@DOCBOOKXSL_HTML@"/> -<xsl:include href="chunk-filename.xsl" /> +<xsl:include href="html/chunk.xsl" /> <xsl:include href="common.xsl" /> <xsl:include href="html-common.xsl" /> Index: php-gtk/docs/stylesheets/xsl/html/chunk-common.xsl +++ php-gtk/docs/stylesheets/xsl/html/chunk-common.xsl <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:saxon="http://icl.com/saxon" xmlns:lxslt="http://xml.apache.org/xslt" xmlns:xalanredirect="org.apache.xalan.xslt.extensions.Redirect" xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" version="1.0" exclude-result-prefixes="doc" extension-element-prefixes="saxon xalanredirect lxslt"> <xsl:output method="html" encoding="ISO-8859-1" indent="no"/> <xsl:param name="html.ext" select="'.html'"/> <xsl:param name="root.filename" select="'index'"/> <xsl:param name="base.dir" select="''"/> <doc:param name="base.dir" xmlns=""> <refpurpose>Output directory for chunks</refpurpose> <refdescription> <para>If specified, the <literal>base.dir</literal> identifies the output directory for chunks. (If not specified, the output directory is system dependent.)</para> </refdescription> </doc:param> <!-- ==================================================================== --> <!-- What's a chunk? appendix article bibliography in article or book book chapter colophon glossary in article or book index in article or book part preface refentry reference sect1 if position()>1 section if position()>1 && parent != section set setindex classset classentry --> <!-- ==================================================================== --> <xsl:template name="chunk"> <xsl:param name="node" select="."/> <!-- returns 1 if $node is a chunk --> <xsl:choose> <xsl:when test="name($node)='sect1' and count($node/preceding-sibling::sect1) > 0">1</xsl:when> <xsl:when test="name($node)='section' and count($node/parent::section) = 0 and count($node/preceding-sibling::section) > 0">1</xsl:when> <xsl:when test="name($node)='preface'">1</xsl:when> <xsl:when test="name($node)='chapter'">1</xsl:when> <xsl:when test="name($node)='appendix'">1</xsl:when> <xsl:when test="name($node)='article'">1</xsl:when> <xsl:when test="name($node)='part'">1</xsl:when> <xsl:when test="name($node)='reference'">1</xsl:when> <xsl:when test="name($node)='refentry'">1</xsl:when> <xsl:when test="name($node)='index' and (name($node/parent::*) = 'article' or name($node/parent::*) = 'book')">1</xsl:when> <xsl:when test="name($node)='bibliography' and (name($node/parent::*) = 'article' or name($node/parent::*) = 'book')">1</xsl:when> <xsl:when test="name($node)='glossary' and (name($node/parent::*) = 'article' or name($node/parent::*) = 'book')">1</xsl:when> <xsl:when test="name($node)='colophon'">1</xsl:when> <xsl:when test="name($node)='book'">1</xsl:when> <xsl:when test="name($node)='set'">1</xsl:when> <xsl:when test="name($node)='setindex'">1</xsl:when> <xsl:when test="name($node)='classset'">1</xsl:when> <xsl:when test="name($node)='classentry'">1</xsl:when> <xsl:otherwise>0</xsl:otherwise> </xsl:choose> </xsl:template> <!-- ==================================================================== --> <xsl:template match="*" mode="chunk-filename"> <xsl:param name="recursive" select="false()"/> <!-- returns the filename of a chunk --> <xsl:variable name="ischunk"><xsl:call-template name="chunk"/></xsl:variable> <xsl:variable name="filename"> <xsl:call-template name="dbhtml-filename"/> </xsl:variable> <xsl:variable name="dir"> <xsl:call-template name="dbhtml-dir"/> </xsl:variable> <xsl:choose> <xsl:when test="$ischunk='0'"> <!-- if called on something that isn't a chunk, walk up... --> <xsl:choose> <xsl:when test="count(parent::*)>0"> <xsl:apply-templates mode="chunk-filename" select="parent::*"> <xsl:with-param name="recursive" select="$recursive"/> </xsl:apply-templates> </xsl:when> <!-- unless there is no up, in which case return "" --> <xsl:otherwise></xsl:otherwise> </xsl:choose> </xsl:when> <xsl:when test="not($recursive) and $filename != ''"> <!-- if this chunk has an explicit name, use it --> <xsl:if test="$dir != ''"> <xsl:value-of select="$dir"/> <xsl:text>/</xsl:text> </xsl:if> <xsl:value-of select="$filename"/> </xsl:when> <xsl:when test="not($recursive) and @id != '' and $use.id.as.filename=1 and name(.) != 'book'"> <!-- if this chunk has an explicit name in id attribute, use it --> <xsl:if test="$dir != ''"> <xsl:value-of select="$dir"/> <xsl:text>/</xsl:text> </xsl:if> <xsl:value-of select="@id"/> <xsl:value-of select="$html.ext"/> </xsl:when> <xsl:otherwise> <xsl:text>chunk-filename-error-</xsl:text> <xsl:value-of select="name(.)"/> <xsl:number level="any" format="01" from="set"/> <xsl:if test="not($recursive)"> <xsl:value-of select="$html.ext"/> </xsl:if> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- ==================================================================== --> <xsl:template name="href.target"> <xsl:param name="object" select="."/> <xsl:variable name="ischunk"> <xsl:call-template name="chunk"> <xsl:with-param name="node" select="$object"/> </xsl:call-template> </xsl:variable> <xsl:apply-templates mode="chunk-filename" select="$object"/> <xsl:if test="$ischunk='0'"> <xsl:text>#</xsl:text> <xsl:call-template name="object.id"> <xsl:with-param name="object" select="$object"/> </xsl:call-template> </xsl:if> </xsl:template> <!-- ==================================================================== --> <xsl:template name="process-chunk-element"> <xsl:variable name="root" select="count(parent::*) &gt; 0"/> <xsl:variable name="prev" select="(preceding::book[1] |preceding::preface[1] |preceding::chapter[1] |preceding::appendix[1] |preceding::part[1] |preceding::classset[1] |preceding::classentry[1] |preceding::reference[1] |preceding::refentry[1] |preceding::colophon[1] |preceding::sect1[name(preceding-sibling::*[1]) = 'sect1'][1] |preceding::section[name(preceding-sibling::*[1]) = 'section' and name(parent::*) != 'section'][1] |preceding::article[1] |preceding::bibliography[1] |preceding::glossary[1] |preceding::index[1] |preceding::setindex[1] |ancestor::set |ancestor::book[1] |ancestor::preface[1] |ancestor::chapter[1] |ancestor::appendix[1] |ancestor::part[1] |ancestor::reference[1] |ancestor::classset[1] |ancestor::article[1])[last()]"/> <xsl:variable name="next" select="(following::book[1] |following::preface[1] |following::chapter[1] |following::appendix[1] |following::part[1] |following::classset[1] |following::classentry[1] |following::reference[1] |following::refentry[1] |following::colophon[1] |following::sect1[1] |following::section[name(parent::*) != 'section'][1] |following::bibliography[1] |following::glossary[1] |following::index[1] |following::article[1] |following::setindex[1] |descendant::book[1] |descendant::preface[1] |descendant::chapter[1] |descendant::appendix[1] |descendant::article[1] |descendant::bibliography[1] |descendant::glossary[1] |descendant::index[1] |descendant::colophon[1] |descendant::setindex[1] |descendant::part[1] |descendant::classset[1] |descendant::classentry[1] |descendant::reference[1] |descendant::refentry[1] |descendant::sect1[2] |descendant::section[name(parent::*) != 'section'][2])[1]"/> <xsl:variable name="ischunk"> <xsl:call-template name="chunk"/> </xsl:variable> <xsl:variable name="chunkfn"> <xsl:if test="$ischunk='1'"> <xsl:apply-templates mode="chunk-filename" select="."/> </xsl:if> </xsl:variable> <xsl:if test="$ischunk='0'"> <xsl:message> <xsl:text>Error </xsl:text> <xsl:value-of select="name(.)"/> <xsl:text> is not a chunk!</xsl:text> </xsl:message> </xsl:if> <xsl:variable name="filename"> <xsl:call-template name="make-relative-filename"> <xsl:with-param name="base.dir" select="$base.dir"/> <xsl:with-param name="base.name" select="$chunkfn"/> </xsl:call-template> </xsl:variable> <xsl:message> <xsl:text>Writing </xsl:text> <xsl:value-of select="$filename"/> <xsl:text> for </xsl:text> <xsl:value-of select="name(.)"/> </xsl:message> <xsl:call-template name="write.chunk"> <xsl:with-param name="filename" select="$filename"/> <xsl:with-param name="content"> <xsl:call-template name="chunk-element-content"> <xsl:with-param name="prev" select="$prev"/> <xsl:with-param name="next" select="$next"/> </xsl:call-template> </xsl:with-param> </xsl:call-template> </xsl:template> <!-- ==================================================================== --> <xsl:template match="/"> <xsl:choose> <xsl:when test="$rootid != ''"> <xsl:choose> <xsl:when test="count(id($rootid)) = 0"> <xsl:message terminate="yes"> <xsl:text>ID '</xsl:text> <xsl:value-of select="$rootid"/> <xsl:text>' not found in document.</xsl:text> </xsl:message> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="id($rootid)"/> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:apply-templates/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="set|book|part|preface|chapter|appendix |article |classset|classentry |reference|refentry |sect1[position()>1] |section[position()>1 and name(parent::*) != 'section'] |book/glossary|article/glossary |book/bibliography|article/bibliography |colophon"> <xsl:call-template name="process-chunk-element"/> </xsl:template> <xsl:template match="setindex |book/index |article/index"> <!-- some implementations use completely empty index tags to indicate --> <!-- where an automatically generated index should be inserted. so --> <!-- if the index is completely empty, skip it. --> <xsl:if test="count(*)>0"> <xsl:call-template name="process-chunk-element"/> </xsl:if> </xsl:template> <!-- ==================================================================== --> </xsl:stylesheet> Index: php-gtk/docs/stylesheets/xsl/html/chunk.xsl +++ php-gtk/docs/stylesheets/xsl/html/chunk.xsl <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:saxon="http://icl.com/saxon" xmlns:lxslt="http://xml.apache.org/xslt" xmlns:xalanredirect="org.apache.xalan.xslt.extensions.Redirect" xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" version="1.0" exclude-result-prefixes="doc" extension-element-prefixes="saxon xalanredirect lxslt"> <xsl:include href="chunk-common.xsl"/> <!-- ==================================================================== --> </xsl:stylesheet>
« previous php.gtk (#979) next »