Subject: RE: [xsl] simple tree problem ... From: "Christopher R. Maden" <crism@xxxxxxxxx> Date: Thu, 25 Oct 2001 04:23:07 -0700 |
> First there was a tree ... > <snip> > <position> 1 > <position> 2 > <position/> 3 > </position> > <position/> 4 > </position> > <position/> 5 > </snip>
One way of doing a breadth-first tree walk is:
<xsl:template match="position"> <xsl:apply-templates select="child::position" mode="visit"/> <xsl:apply-templates select="child::position"/> </xsl:template>
<xsl:template match="position" mode="visit"> <xsl:value-of select="."/> </xsl:template>
contents-of-1-2-3-and-4 contents-of-5 contents-of-2-and-3 contents-of-4 contents-of-3
<xsl:template match="position" mode="visit"> <xsl:apply-templates select="text()"/> </xsl:template>
-Chris -- Christopher R. Maden, Principal Consultant, HMM Consulting Int'l, Inc. DTDs/schemas - conversion - ebooks - publishing - Web - B2B - training <URL: http://www.hmmci.com/ > <URL: http://crism.maden.org/consulting/ > PGP Fingerprint: BBA6 4085 DED0 E176 D6D4 5DFC AC52 F825 AFEC 58DA
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] simple tree problem ..., Michael Kay | Thread | [xsl] Namespace problem, Uslu, Cihan Y (MED) |
RE: [xsl] static vars or how to wri, Michael Kay | Date | [xsl] Depth first search of cyclic , WATKIN-JONES,ADAM (H |
Month |