[xsl] Create for-each loop inside another loop base on the first Element

Subject: [xsl] Create for-each loop inside another loop base on the first Element
From: "Kevin Yao" <KYao@xxxxxxxxxxxxxx>
Date: Fri, 3 Mar 2006 10:23:16 -0600
First time using this XSLT programming. I had some help over at the
Stylus Studio Forum but it seems that my problem is quite complex.
Here is the situation:

-Loop-LIN
  Segment-LIN
    Element-234
    Element-357
  Segment-PO4
  Loop-FST
     Segment-FST
        Element-373
        Element-373_1
        Element-380_2
     Segment-SDQ
        Element-67_1
        Element-67
        Element-67_2
        Element-67_3
        Element-67_4
        Element-67_5
        Element-67_6
        Element-67_7
        Element-67_8
        Element-67_9
  +Loop-FST
  +Loop-FST
  +Loop-FST
  +Loop-FST
+Loop-LIN
+Loop-LIN
+Loop-LIN
+Loop-LIN
+Loop-LIN
+Loop-LIN

Here is what I need it to output:

<xsl:for-each select="Loop-FST/Segment-SDQ/Element-67*"> (* can be
1,2,3,4,5,.....)
    Employee: <xsl:value-of select="Element-67*">
    <xsl:for-each select="Loop-LIN">
    <xsl:value-of select="Segment-LIN/Element-234">
    <xsl:value-of select="Segment-LIN/Element-257">
    <xsl:value-of select="Loop-FST/Segment-FST/Element-373">
    <xsl:value-of select="Loop-FST/Segment-FST/Element-373_1">
    <xsl:value-of select="Loop-FST/Segment-FST/Element-380_2">
    </xsl:for-each>
</xsl:for-each>

The second <xsl:for-each select="Loop-LIN"> needs to output whatever the
first <xsl:for-each ....."Element67*"> is. The difficulty is that the
first Element-67_3 in Loop-FST might be different than the third
Loop-FST.

Any help would be appreciated.

~Kevin

Current Thread