Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: traversing associations traversing associationsTo: NULL Date: 5/4/2005 5:30:00 PM I've have a set of <class> nodes. They may have <association> children which
in turn have a 'target' attribute with the name of other classes. So,
basically, some classes are associated with other classes.
I would like to seed a stylesheet with the name of a class and then have it
traverse the associations through the classes.
I've got one stylesheet 'report-subgoals-list' that calls another stylesheet
'subgoals-list' and passes a class-name parameter. Iterating though its
<association>s, each one's target value is displayed, and then the
"subgoals-list' stylesheet is called in an attempt to recursively traverse
the associations. Note: the associations are NOT circular.
Here's the call from the 'report-subgoals-list' stylesheet:
<xsl:call-template name="subgoals-list">
<xsl:with-param name="class-name">XYZ</xsl:with-param>
</xsl:call-template>
and of the essence of the 'subgoals-list' stylesheet:
<xsl:for-each select="//class[@name= $class-name]">
<xsl:for-each select="association">
<div class="generaltext"><xsl:value-of select="@target"/></div>
<xsl:if test="//class">
<xsl:call-template name="subgoals-list">
<xsl:with-param name="class-name"><xsl:value-of
select="@target"/></xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
These stylesheets do produce output but it's difficult to interpret their
success since all targets are rendered similarly. Ideally, I'd like to
indent a list of targets relative to their parent. Any thoughts as to how
this could be done assuming a indeterminate number of indentations would be
really appreciated.
FYI, I'm using a processor that supports only XSL 1.0.
Thanks in advance,
David
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
