[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook] XSL question
On Sun, Feb 29, 2004 at 10:15:20PM -0500, Matej Cepl wrote: > <xsl:template match="sect1"> > <h1> > <xsl:value-of select="title"/> > </h1> > <xsl:apply-templates/> > </xsl:template> > > then this piece of source code: > > <sect1><title>New vimoutliner</title> > <warning><para>February 18, 2004</para></warning> > <para>Ukazkovy text</para> > </sect1> > > gives this output: > > <h1>New vimoutliner</h1>New vimoutliner > <p class="date">February 18, 2004</p> > <p>Ukazkovy text</p> > > which is not what I want (text of <title> is used twice). You are selecting 'title' explicitly, and then matching it again with the unrestricted 'apply-templates'---the default template (since there is no explicit 'title' template) just prints the content of the 'title' element. Among the possible solutions, you could leave everything precisely as it is and add: <xsl:template match="title"/> Or, delete everything within and including the 'h1' element in the 'sect1' template, and add: <xsl:template match="title"> <h1><value-of select="."/></h1> </xsl:template> -- Paul. mailto:paulh@logicsquad.net mailto:phoadley@maths.adelaide.edu.au
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]