This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: designing an XSL stylesheet for "pidgin" docbook
- From: Bob Stayton <bobs at caldera dot com>
- To: "Robert P. J. Day" <rpjday at mindspring dot com>
- Cc: docbook apps list <docbook-apps at lists dot oasis-open dot org>
- Date: Tue, 18 Feb 2003 09:58:44 -0800
- Subject: Re: DOCBOOK-APPS: designing an XSL stylesheet for "pidgin" docbook
- References: <Pine.LNX.4.44.0302181133430.16390-100000@dell>
On Tue, Feb 18, 2003 at 11:41:32AM -0500, Robert P. J. Day wrote:
>
> i'm following the advice of one of the posters here and designing
> an XSL stylesheet that will allow me to write in what i'm calling
> "pidgin" docbook, with shortcuts for all of the elements i use,
> like <p> for <para>, <em> for <emphasis>, and so on.
>
> what i'm not clear on is how to write a template for an
> element that contains mixed content. this is what markus
> spath posted to help me out:
>
> > <xsl:template match="@* | node()">
> > <xsl:copy><xsl:apply-templates select="@* | node()" /></xsl:copy>
> > </xsl:template>
> >
> > <xsl:template match="li">
> > <listitem><para><xsl:apply-templates /></para></listitem>
> > </xsl:template>
>
> obviously, in the case of the "li" element, i want to apply templates
> to all of the content, including just copying the text over untouched.
> is that what that first template definition is specifying? that
> any non-element content is just copied?
Yes, node() matches element, text, pi, and comments nodes.
All but attribute nodes, which is why you also need @*.
--
Bob Stayton 400 Encinal Street
Publications Architect Santa Cruz, CA 95060
Technical Publications voice: (831) 427-7796
The SCO Group fax: (831) 429-1887
email: bobs@sco.com