This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: captured in a <xsl:for-each>
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] captured in a <xsl:for-each>
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Mon, 23 Jul 2001 17:52:52 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
Perhaps you want <xsl:for-each select="ancestor::title"/>? But even then,
you must avoid the code that processes the title element recursing to
process its descendant <kapitel> elements. Just modify the
<xsl:apply-templates> to be more selective.
Mike Kay
Software AG
> -----Original Message-----
> From: owner-xsl-list@lists.mulberrytech.com
> [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Roman
> Huditsch
> Sent: 23 July 2001 13:09
> To: xsl-list@lists.mulberrytech.com
> Subject: [xsl] captured in a <xsl:for-each>
>
>
> Hi there!
>
> I seem to be captured in a for-each loop. Can someone please
> help me to
> escape and get the expected result?
>
> <xsl:template match="node()|@*">
> <xsl:copy>
> <xsl:apply-templates select="node()|@*"/>
> </xsl:copy>
> </xsl:template>
>
> <xsl:template match="kapitel">
> <xsl:for-each select="//title"> <!-- "title" is
> hierarchically above "kapital" -->
> <p>
> <xsl:apply-templates/>
> </p>
> </xsl:for-each>
> </xsl:template>
>
> ...
>
>
>
> I would like to create a <p> tag for each title and within this
> paragraph I want to copy all the nodes and attributes as they
> are in the
> source file.
> But with the syntax above I just get an infinite template recursion.
> Could you please help me?
>
> Cheers,
> Roman
>
>
> > Roman Huditsch (RH )
> >
> _____________________________________________________________________
> > hico Informations- und Kommunikations-Management Gesellschaft m.b.H.
> > TechLab, Thomas A. Edison Straße 2.
> > A-7000 Eisenstadt / Austria
> > phone: +43/2682/704-61-00; fax: +43/2682/704-71-61-10
> > e-mail:support@hico.com; r.huditsch@hico.com
> >
> >
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list