xsl-list
[Top] [All Lists]

Re: nesting flat XML based on attribute value.

2005-12-14 04:41:17
Hi Dave,


it needs to some how remember what it has already grouped (sorry for the
procedural thinking here.)

This isn't too much of a problem in this case because I can remove those extra
sec tags with a second script based on depth.

How do you apply the sec template in the first occurrence?

<xsl:template match="ch">
..
<xsl:apply-templates select="sec"/>  <- This will select too much

You need to find out which elements are the top level ones, for
example this way (where string-length(@id) is known):
<xsl:apply-templates select="sec[string-length(@id)=8]"/>
..

This is an example. You might want to use modes, as another approach.

Regards,
Ragulf Pickaxe :-)

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--