[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Create for-each loop inside another loop base on t

Subject: RE: Create for-each loop inside another loop base on the first Element
From: cknell@xxxxxxxxxx
Date: Fri, 03 Mar 2006 11:26:10 -0500
for each loop
It will be simpler for us to help you if you included the actual XML you are trying to transform. The stuff you sent requires us to convert it to XML ourselves to work on it. The easier you make it for us, the more likely you are to get help.
-- 
Charles Knell
cknell@xxxxxxxxxx - email



-----Original Message-----
From:     Kevin Yao <KYao@xxxxxxxxxxxxxx>
Sent:     Fri, 3 Mar 2006 10:23:16 -0600
To:       <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject:   Create for-each loop inside another loop base on the first Element

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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.