Subject: RE: [xsl] step-by-step work instructions -- recursive apply-templ ates to create html table From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Thu, 10 Apr 2003 15:14:19 -0400 |
http://www.biglist.com/lists/xsl-list/archives/200304/msg00049.html
<div><label>1</label> <div><label>1.1</label> <div><label>1.1.1</label></div> </div> <div><label>1.2</label></div> <div>
A. <xsl:template match="div"> <part> <xsl:apply-templates/> </part> </xsl:template>
A1. <xsl:template match="div"> <part> <xsl:apply-templates select="label"/> </part> <xsl:apply-templates select="div"/> </xsl:template>
B. <xsl:template match="label"> <head> <xsl:apply-templates/> </head> </xsl:template>
<part> <head>1</head> <part> <head>1.1</head> <part> <head>1.1.1</head> </part> </part> <part> <head>1.2</head> </part> </part>
<part> <head>1</head> </part> <part> <head>1.1</head> </part> <part> <head>1.1.1</head> </part> <part> <head>1.2</head> </part>
B1. <xsl:template match="label"> <head> <xsl:for-each select="ancestor::div"> <xsl:text>#</xsl:text> </xsl:for-each> <xsl:apply-templates/> </head> </xsl:template>
<part> <head>1</head> </part> <part> <head>#1.1</head> </part> <part> <head>##1.1.1</head> </part> <part> <head>###1.2</head> </part>
Also, just so you don't think I'm TRYING, I'm on my third XSLT book...but I can't find examples anywhere to match what I've been asking here.
Good luck, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Grouping by an attribute , David Carlisle | Thread | [xsl] xsl:eval, Rajesh Jivangikar |
Re: [xsl] XPath and Recursive Desce, Jeff Kenton | Date | Re: [xsl] How to render TEI <div*>s, James J. Ramsey |
Month |