Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


traversing associations

From: "David Schwartz" <drs58@---.--->
To: 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




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent