[Home] [By Thread] [By Date] [Recent Entries]
Darrell,
At 04:32 PM 8/27/2002, you wrote: surely this list has seen this before? Yep. Actually, just this morning. Check out the thread " Constructing hierarchical XML from a flat XML-tag sequence using XSLT", which Mike Kay and Tom Schutzer answered. It's also in the FAQ: check out http://www.dpawson.co.uk/xsl/sect2/flatfile.html. Basically it's a grouping problem. Your choice is whether to select nodes based directly on their relative positions in the flat (non-)hierarchy, or whether to do effectively the same thing using keys (which is good if the case is complex, but it doesn't look as though yours is). Adapting Mike's solution from earlier today to your case: <xsl:template match="a">
<div>
<xsl:copy-of select="."/>
<xsl:copy-of select="following-sibling::*
[generate-id(preceding-sibling::a[1])=generate-id(current())]">
</div>
</xsl:template>Make sense? Cheers, Wendell hello xsl list, ====================================================================== 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 ====================================================================== XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|

Cart



