This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: XSL: transforming DocBook
- From: Jens Stavnstrup <js at ddre dot dk>
- To: Jochen Hein <jochen at jochen dot org>
- Cc: docbook-apps at lists dot oasis-open dot org
- Date: Mon, 11 Feb 2002 15:27:12 +0100 (CET)
- Subject: Re: DOCBOOK-APPS: XSL: transforming DocBook
On Mon, 11 Feb 2002, Jens Stavnstrup wrote:
Jochen,
I forgot something in my previous example (aasuming your docbook element
is book):
<xsl:template match="book">
<appendix>
<xsl:apply-templates/>
</appendix>
</xsl:template>
And ofcourse, you have to create templates for the other DocBook elements,
you are using.
One general rule in all transformation: Use xsl:apply-templates as much as
possible, it will simplifies your style sheet tremedously, and is a very
effecient tool.
Regards
Jens
> On Sun, 10 Feb 2002, Jochen Hein wrote:
>
>
> Piece of cake:
>
>
> <xsl:temlate match="appendix">
> <chapter>
> <xsl:apply-templates/>
> </chapter>
> </xsl:template>
>
> <xsl:template match="title">
> <xsl:copy-of select="."/>
> </xsl:template>
>
>
> Regards
>
> Jens
>
>
> >
> > I'm still struggling with a DocBook to foreign DTD translation. All
> > earlier tips have helped me, so thanks to all of you. What I have to
> > do know is the following:
> >
> > Docbook has the content model:
> > <appendix><title>a title</title>...</appendix>
> > <appendix><title>a second title</title>...</appendix>
> > <appendix><title>a third title</title>...</appendix>
> >
> > What I have to generate is:
> > <appendix>
> > <chapter><title>a title</title>...</chapter>
> > <chapter><title>a second title</title>...</chapter>
> > <chapter><title>a third title</title>...</chapter>
> > </appendix>
> >
> > Currently I misuse a <part> in Docbook, but I'd like to avoid that.
> > I do find the first appendix with XSL, but I don't seem to get it
> > done. Any ideas?
> >
> > Jochen
> >
> >
>
>
>
>
>
>