[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSL-loop
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
|
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
|