[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] looping through result tree fragments to aggregatedata


Subject: RE: [xsl] looping through result tree fragments to aggregatedata
From: Erika Marlow <EMarlow@xxxxxxxxxxxxxx>
Date: Tue, 27 May 2003 08:50:42 -0500

<snip - Wendell said:>
Also, depending on the original problem, sometimes you don't even need the 
original aggregation step, or can perform it in such a way that you can 
aggregate a node set, not an RTF. (One would have to see that for-each loop 
to know in your case. Does its operation merely collect a node set, or does 
it do something more complex?) If you can do this, you can process this 
node set; the problem goes away.
</snip>

What follows is a variable containing a for-each loop that collects the
nodes needed for further processing later in the XSL. As far as I can tell,
it is simply collecting the nodes based on certain criteria. If this can be
translated into a node-set, I would certainly appreciate pointers on how to
modify it.  
Thank you,
Erika

<xsl:variable name="xactmonth">
  <xsl:for-each select="elig/eligtrans/origreq/eliginq[count(. | 
   key('monthskey' , substring(@reqdate,1,6))[1]) = 1]" >
    <reqmonth>
	<xsl:attribute name = "month">
	<xsl:value-of select="substring(@reqdate,5,2)" />
	</xsl:attribute>
	<xsl:attribute name = "year">
	<xsl:value-of select="substring(@reqdate,1,4)" />
	</xsl:attribute>
	<xsl:variable name="curReqMonth" select = "substring(@reqdate,1,6)"
/>
	  <xsl:for-each select="//elig/eligtrans
[substring(origreq/eliginq/@reqdate,1,6)=$curReqMonth]">
	    <xaction>
		<xsl:attribute name="site">
		<xsl:value-of select="origreq/eliginq/gedisid" />
		</xsl:attribute>
		<xsl:attribute name="payer">
		<xsl:value-of select="origreq/eliginq/gedipid" />
		</xsl:attribute>
		<xsl:attribute name="rej">
		  <xsl:choose>
		    <xsl:when test="resp/eligresp/sub/reject">1</xsl:when>
		    <xsl:otherwise>0</xsl:otherwise>
		  </xsl:choose>
		</xsl:attribute>
	    </xaction>		
	  </xsl:for-each>
    </reqmonth>	
  </xsl:for-each>
</xsl:variable>




------------  Gateway EDI, Inc.  ---------------------------------------------------------------------------------------------------

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed.  If you are not the intended addressee, or the person responsible for delivering it to them, you may not copy, forward, disclose or otherwise use it or any part of it in any way.  To do so may be unlawful.  If you receive this email by mistake, please advise the sender immediately and destroy all copies of the original message.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread