[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSL-loop

Subject: Re: XSL-loop
From: Larry Garfield <lgarfiel@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 22 Mar 2001 20:53:50 -0600
xsl loop processing
If you have a small, known number of layers, then probably the most straight-forward solution would be several different templates, like so:

<xsl:template match="p">
    <h1><xsl:value-of select="@title" /></h1>
    <xsl:apply-templates />
</xsl:template>

<xsl:template match="p/p">
    <h2><xsl:value-of select="@title" /></h2>
    <xsl:apply-templates />
</xsl:template>

<xsl:template match="p/p/p">
    <h3><xsl:value-of select="@title" /></h3>
    <xsl:apply-templates />
</xsl:template>

That would require less processing.  If you need to have an arbitrary number, I'm not quite sure.

Mark Gray wrote:

> In my DTD i've created a P-tag. It can contain many different elements - also other P's. A P-element has an attribute called Title. It contains the title of a block of text (p for paragraph!). I would like to display the titles of the different P-elements with a different headersize for each title depending on its position in the XML-tree (how many P-ancestors does it have).
>
> Mark
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

--
Larry Garfield
lgarfiel@xxxxxxxxxxxxxxxxxxx

Do you have a PalmOS Organizer?  Click here to add me to your address book:
http://signature.coola.com/?lgarfiel@xxxxxxxxxxxxxxxxxxx

-- "If at first you don't succeed, skydiving isn't for you." :-)



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • XSL-loop
    • Mark Gray - Thu, 22 Mar 2001 21:03:17 -0500 (EST)
      • Larry Garfield - Thu, 22 Mar 2001 21:55:07 -0500 (EST) <=
      • Jeni Tennison - Fri, 23 Mar 2001 06:57:40 -0500 (EST)

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.