[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: different templates
On Mon, Oct 29 '01 at 10:29, Ingo Friepoertner wrote: > I (think I) need 2 different apply-templates which match the same xml > node in a stylesheet. What for? > How can I do this without conflicts? > > <xsl:template match="var"> <!-- foo --> </xsl:template> > <xsl:template match="var"> <!-- bar --> </xsl:template> Not at all, how should the processor (or anyone else) know when to use which template? > Well, there must be a simple solution ... > Problem: I need the elements and id's from 'vars' in different parts of > html output. You could use: - modes <xsl:template match="var"> <!-- foo --> </xsl:template> <xsl:template match="var" mode="ids"> <!-- bar --> </xsl:template> and use <xsl:apply-templates /> <xsl:apply-templates mode="ids" /> - for-each <!-- ... build your result --> <xsl:for-each select="var/@id"> <!-- print id --> </xsl:for-each> - there are more ways for sure ;-) -- Goetz Bock IT Consultant Dipl.-Inf. Univ. Attachment:
pgp00017.pgp
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|