homepage Welcome to WebmasterWorld Guest from 54.167.174.90
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

    
XSLT Math Question
DevZero



 
Msg#: 4412081 posted 4:47 pm on Jan 29, 2012 (gmt 0)

I've got a bit of an issue that I'm hoping to get some help with. I know that variables in XSL are immutable. I've got an XML that contains Check objects. Within those objects there is an Amount field under the Mij tag. An XML can have multiple checks within them, and the number is not set. I have to add up all the amount fields for all the checks, then use that value on the BT-SUMMARY Page 2, under SPLCKPLUS, and Subtract the value of Balance Due from the total value of the checks.

This is the original XML.



<?xml version="1.0"?>
<BATCH PROCESSDATE="20120125">
<BATCHDIRPATH>D:\qmserver35\IMAGES\OUT\2012\01\17\08412011100002\</BATCHDIRPATH>
<BATCHNUMBER>08412011100002_001</BATCHNUMBER>
<SUBMISSION SUBNUM="1">
<PAGE PAGENUM="1">
<TOKEN>
<ARTIFICIAL_OCR>0</ARTIFICIAL_OCR>
<BARCODE/>
<DOCID>1</DOCID>
<ERRORSTATUS/>
<PFORMTYPE>CHECK</PFORMTYPE>
<PFORMTYPERAW>CHECK</PFORMTYPERAW>
<PPAGENUM>1</PPAGENUM>
<PPAGETYPE>FORM</PPAGETYPE>
<PSZAMTCOR/>
<PSZAMTRAW/>
</TOKEN>
<MIJ>
<CHECKAMOUNT CONFIDENCE="290">3202.00</CHECKAMOUNT>
</MIJ>
</PAGE>
<PAGE PAGENUM="2">
<TOKEN>
<ARTIFICIAL_OCR>0</ARTIFICIAL_OCR>
<BARCODE/>
<DOCID>1</DOCID>
<ERRORSTATUS/>
<IBMLFORMNAME>Check</IBMLFORMNAME>
<PFORMTYPE>CHECK_R</PFORMTYPE>
<PFORMTYPERAW>CHECK_R</PFORMTYPERAW>
<PPAGENUM>2</PPAGENUM>
<PPAGETYPE>FORM</PPAGETYPE>
</TOKEN>
<MIJ>
<DUMMY CONFIDENCE="243">T</DUMMY>
</MIJ>
</PAGE>
<PAGE PAGENUM="3">
<TOKEN>
<ARTIFICIAL_OCR>0</ARTIFICIAL_OCR>
<BARCODE/>
<DOCID>1</DOCID>
<ERRORSTATUS/>
<PFORMTYPE>CHECK</PFORMTYPE>
<PFORMTYPERAW>CHECK</PFORMTYPERAW>
<PPAGENUM>1</PPAGENUM>
<PPAGETYPE>FORM</PPAGETYPE>
<PSZAMTCOR/>
<PSZAMTRAW/>
</TOKEN>
<MIJ>
<CHECKAMOUNT CONFIDENCE="290">3202.00</CHECKAMOUNT>
</MIJ>
</PAGE>
<PAGE PAGENUM="4">
<TOKEN>
<ARTIFICIAL_OCR>0</ARTIFICIAL_OCR>
<BARCODE/>
<DOCID>1</DOCID>
<ERRORSTATUS/>
<IBMLFORMNAME>Check</IBMLFORMNAME>
<PFORMTYPE>CHECK_R</PFORMTYPE>
<PFORMTYPERAW>CHECK_R</PFORMTYPERAW>
<PPAGENUM>2</PPAGENUM>
<PPAGETYPE>FORM</PPAGETYPE>
</TOKEN>
<MIJ>
<DUMMY CONFIDENCE="243">T</DUMMY>
</MIJ>
</PAGE>
<PAGE PAGENUM="5">
<TOKEN>
<ARTIFICIAL_OCR>0</ARTIFICIAL_OCR>
<BARCODE>0BTSUM1110841</BARCODE>
<DOCID>2</DOCID>
<ERRORSTATUS/>
<IBMLFIELD3OF9>0BTSUM1110841</IBMLFIELD3OF9>
<IBMLFORMNAME>BT-SUMMARY page 1</IBMLFORMNAME>
<IMAGEFILENAME_1>D:\qmserver35\IMAGES\OUT\2012\01\17\08412011100002\10000002.tif</IMAGEFILENAME_1>
<IMAGEFILENAME_2>D:\qmserver35\IMAGES\OUT\2012\01\17\08412011100002\11000002.jpg</IMAGEFILENAME_2>
<IMAGEFILENAMECOLOR>11000002.jpg</IMAGEFILENAMECOLOR>
<IMAGESIDE>Front</IMAGESIDE>
<IMGFILENAME>10000002.tif</IMGFILENAME>
<PAGEDLN>08412011FFAX_435970002_0002</PAGEDLN>
<PAGEINDEX>2</PAGEINDEX>
<PCAERROR>0</PCAERROR>
<PCAPELAPSESECOND>28.1323218453908</PCAPELAPSESECOND>
<PDATACAPTURE>Y</PDATACAPTURE>
<PDATECAPTURE35>Image cannot be loaded: File D:\qmserver35\IMAGES\OUT\2012\01\17\08412011100002\10000002.tif is not found </PDATECAPTURE35>
<PDFAMTCOR>0</PDFAMTCOR>
<PDFAMTRAW>0</PDFAMTRAW>
<PFORMIDMETHOD/>
<PFORMTYPE>BTSUMMARY_2011_0841_P1</PFORMTYPE>
<PFORMTYPERAW>BTSUMMARY_2011_0841_P1</PFORMTYPERAW>
<PPAGENUM>3</PPAGENUM>
<PPAGETYPE>FORM</PPAGETYPE>
<PRETNUM>0</PRETNUM>
<PSCANLINE/>
<PSLERROR>0</PSLERROR>
<PSUBNUM>1</PSUBNUM>
<PSZAMTCOR/>
<PSZAMTRAW/>
</TOKEN>
<MIJ>
<PERBEGDT CONFIDENCE="900">0101201</PERBEGDT>
<PERENDDT CONFIDENCE="900">91231201</PERENDDT>
<FORMERNAMECB CONFIDENCE="560">1</FORMERNAMECB>
<FORMERNAME CONFIDENCE="253">INNCNEIASTNIIING UMSTFORMCERNAMME NN I N 7</FORMERNAME>
<LASTNM1 CONFIDENCE="564">PROPRIETOBHIP BSR NA NE </LASTNM1>
<FIRSTNM1 CONFIDENCE="552">AETNAME </FIRSTNM1>
<MIDINIT1 CONFIDENCE="941">M</MIDINIT1>
<INDVIDNO1 CONFIDENCE="355">728089011</INDVIDNO1>
<LASTNM2 CONFIDENCE="304">JOINTI OWNEDPMPEN UANANE </LASTNM2>
<FIRSTNM2 CONFIDENCE="675">ABTNAME </FIRSTNM2>
<MIDINIT2 CONFIDENCE="923">M</MIDINIT2>
<INDVIDNO2 CONFIDENCE="328">338039811</INDVIDNO2>
<PRIMNM CONFIDENCE="254">CIIRP1ONMTOE PTAANIE SI P AT NATEITINI RST</PRIMNM>
<BUSIDNO CONFIDENCE="294">702800280</BUSIDNO>
<PIACODE CONFIDENCE="286">081100</PIACODE>
<STRADDR1 CONFIDENCE="93">NUNNBBN ERKSNTREETNADDRESS NN </STRADDR1>
<STRADDR2 CONFIDENCE="71">ADDRESS FCONTINUEDI </STRADDR2>
<CITY CONFIDENCE="361">CITYLTOWNA N </CITY>
<STATE CONFIDENCE="812">NS</STATE>
<ZIPPSTLCD CONFIDENCE="75">ZIIPIACDEF</ZIPPSTLCD>
<BETCBY CONFIDENCE="1000">0</BETCBY>
<BETCBN CONFIDENCE="1000">0</BETCBN>
<BPTCBY CONFIDENCE="1000">0</BPTCBY>
<BPTCBN CONFIDENCE="1000">0</BPTCBN>
<NP990TFLGY CONFIDENCE="1000">0</NP990TFLGY>
<NP990TFLGN CONFIDENCE="808">0</NP990TFLGN>
<CORPCB CONFIDENCE="1000">1</CORPCB>
<COMBCB CONFIDENCE="392">0</COMBCB>
<PARTCB CONFIDENCE="1000">1</PARTCB>
<NPCB CONFIDENCE="1000">0</NPCB>
<PROPCB CONFIDENCE="792">1</PROPCB>
<FIDCB CONFIDENCE="1000">0</FIDCB>
<AMNDRTNFLG CONFIDENCE="1000">1</AMNDRTNFLG>
<FINLRTNFLG CONFIDENCE="1000">0</FINLRTNFLG>
<RP87FLAG CONFIDENCE="1000">0</RP87FLAG>
<RP87YRS CONFIDENCE="136">608102010510000011</RP87YRS>
</MIJ>
</PAGE>
<PAGE PAGENUM="6">
<TOKEN>
<ARTIFICIAL_OCR>0</ARTIFICIAL_OCR>
<BARCODE>0BTSUM1110841</BARCODE>
<DOCID>2</DOCID>
<ERRORSTATUS/>
<IBMLFORMNAME>BT-SUMMARY page 1</IBMLFORMNAME>
<IMAGEFILENAME_1>D:\qmserver35\IMAGES\OUT\2012\01\17\08412011100002\20000002.tif</IMAGEFILENAME_1>
<IMAGEFILENAME_2>D:\qmserver35\IMAGES\OUT\2012\01\17\08412011100002\21000002.jpg</IMAGEFILENAME_2>
<IMAGEFILENAMECOLOR>21000002.jpg</IMAGEFILENAMECOLOR>
<IMAGESIDE>Back</IMAGESIDE>
<IMGFILENAME>20000002.tif</IMGFILENAME>
<PAGEDLN>08412011FFAX_435970002_0002</PAGEDLN>
<PAGEINDEX>3</PAGEINDEX>
<PCAERROR>0</PCAERROR>
<PCAPELAPSESECOND>0.297126310761087</PCAPELAPSESECOND>
<PDATACAPTURE>Y</PDATACAPTURE>
<PDATECAPTURE35>Image cannot be loaded: File D:\qmserver35\IMAGES\OUT\2012\01\17\08412011100002\20000002.tif is not found </PDATECAPTURE35>
<PDFAMTCOR>0</PDFAMTCOR>
<PDFAMTRAW>0</PDFAMTRAW>
<PFORMIDMETHOD/>
<PFORMTYPE>ATTACHMENT</PFORMTYPE>
<PFORMTYPERAW>ATTACHMENT</PFORMTYPERAW>
<PPAGENUM>4</PPAGENUM>
<PPAGETYPE>FORM</PPAGETYPE>
<PRETNUM>0</PRETNUM>
<PSCANLINE/>
<PSLERROR>0</PSLERROR>
<PSUBNUM>1</PSUBNUM>
<PSZAMTCOR/>
<PSZAMTRAW/>
</TOKEN>
<MIJ>
<DUMMY CONFIDENCE="0"/>
</MIJ>
</PAGE>
<PAGE PAGENUM="7">
<TOKEN>
<ARTIFICIAL_OCR>0</ARTIFICIAL_OCR>
<BARCODE>0BTSUM1120841</BARCODE>
<DOCID>3</DOCID>
<ERRORSTATUS/>
<IBMLFIELD3OF9>0BTSUM1120841</IBMLFIELD3OF9>
<IBMLFORMNAME>BT-Summary page 2</IBMLFORMNAME>
<IMAGEFILENAME_1>D:\qmserver35\IMAGES\OUT\2012\01\17\08412011100002\10000003.tif</IMAGEFILENAME_1>
<IMAGEFILENAME_2>D:\qmserver35\IMAGES\OUT\2012\01\17\08412011100002\11000003.jpg</IMAGEFILENAME_2>
<IMAGEFILENAMECOLOR>11000003.jpg</IMAGEFILENAMECOLOR>
<IMAGESIDE>Front</IMAGESIDE>
<IMGFILENAME>10000003.tif</IMGFILENAME>
<PAGEDLN>08412011FFAX_435970002_0003</PAGEDLN>
<PAGEINDEX>4</PAGEINDEX>
<PCAERROR>0</PCAERROR>
<PCAPELAPSESECOND>2.30548826738959</PCAPELAPSESECOND>
<PDATACAPTURE>Y</PDATACAPTURE>
<PDATECAPTURE35>Image cannot be loaded: File D:\qmserver35\IMAGES\OUT\2012\01\17\08412011100002\10000003.tif is not found </PDATECAPTURE35>
<PDFAMTCOR>0</PDFAMTCOR>
<PDFAMTRAW>0</PDFAMTRAW>
<PFORMIDMETHOD/>
<PFORMTYPE>BTSUMMARY_2011_0841_P2</PFORMTYPE>
<PFORMTYPERAW>BTSUMMARY_2011_0841_P2</PFORMTYPERAW>
<PPAGENUM>5</PPAGENUM>
<PPAGETYPE>FORM</PPAGETYPE>
<PRETNUM>0</PRETNUM>
<PSCANLINE> </PSCANLINE>
<PSLERROR>0</PSLERROR>
<PSUBNUM>1</PSUBNUM>
<PSZAMTCOR/>
<PSZAMTRAW/>
</TOKEN>
<MIJ>
<CRSUB CONFIDENCE="905">,43</CRSUB>
<TAXNETSTCR CONFIDENCE="950">19947</TAXNETSTCR>
<TOTTAXNET CONFIDENCE="925">19990</TOTTAXNET>
<TOTEXTN CONFIDENCE="0"/>
<TOTESTIM CONFIDENCE="926">12500</TOTESTIM>
<TOTPREVYR CONFIDENCE="786">11288</TOTPREVYR>
<TOTPDORIG CONFIDENCE="0"/>
<TOTPYMT CONFIDENCE="941">16788</TOTPYMT>
<BALTAXDUE CONFIDENCE="895">8202</BALTAXDUE>
<TOTINT CONFIDENCE="0"/>
<TOTFP CONFIDENCE="0"/>
<TOTFF CONFIDENCE="0"/>
<TOTUND CONFIDENCE="0"/>
<TOTADDTN CONFIDENCE="0"/>
<SUBTOTAL5A CONFIDENCE="606">,3023</SUBTOTAL5A>
<EFTRETPYT CONFIDENCE="0"/>
<BALANCEDUE CONFIDENCE="0"/>
<OVRPYMT CONFIDENCE="0"/>
<OVRPYMTCR CONFIDENCE="0"/>
<OVRPYMTRFD CONFIDENCE="0"/>
</MIJ>
</PAGE>
<PAGE PAGENUM="8">
<TOKEN>
<ARTIFICIAL_OCR>0</ARTIFICIAL_OCR>
<BARCODE>0BTSUM1120841</BARCODE>
<DOCID>3</DOCID>
<ERRORSTATUS/>
<IBMLFORMNAME>BT-Summary page 2</IBMLFORMNAME>
<IMAGEFILENAME_1>D:\qmserver35\IMAGES\OUT\2012\01\17\08412011100002\20000003.tif</IMAGEFILENAME_1>
<IMAGEFILENAME_2>D:\qmserver35\IMAGES\OUT\2012\01\17\08412011100002\21000003.jpg</IMAGEFILENAME_2>
<IMAGEFILENAMECOLOR>21000003.jpg</IMAGEFILENAMECOLOR>
<IMAGESIDE>Back</IMAGESIDE>
<IMGFILENAME>20000003.tif</IMGFILENAME>
<PAGEDLN>08412011FFAX_435970002_0003</PAGEDLN>
<PAGEINDEX>5</PAGEINDEX>
<PCAERROR>0</PCAERROR>
<PCAPELAPSESECOND>0.938480449316558</PCAPELAPSESECOND>
<PDATACAPTURE>Y</PDATACAPTURE>
<PDATECAPTURE35>Image cannot be loaded: File D:\qmserver35\IMAGES\OUT\2012\01\17\08412011100002\20000003.tif is not found </PDATECAPTURE35>
<PDFAMTCOR>0</PDFAMTCOR>
<PDFAMTRAW>0</PDFAMTRAW>
<PFORMIDMETHOD/>
<PFORMTYPE>ATTACHMENT</PFORMTYPE>
<PFORMTYPERAW>ATTACHMENT</PFORMTYPERAW>
<PPAGENUM>6</PPAGENUM>
<PPAGETYPE>FORM</PPAGETYPE>
<PRETNUM>0</PRETNUM>
<PSCANLINE> </PSCANLINE>
<PSLERROR>0</PSLERROR>
<PSUBNUM>1</PSUBNUM>
<PSZAMTCOR/>
<PSZAMTRAW/>
</TOKEN>
<MIJ>
<DUMMY CONFIDENCE="0"/>
</MIJ>
</PAGE>
<PAGE PAGENUM="9">
<TOKEN>
<ARTIFICIAL_OCR>0</ARTIFICIAL_OCR>
<BARCODE>0BTSUM1130841</BARCODE>
<DOCID>4</DOCID>
<ERRORSTATUS/>
<IBMLFIELD3OF9>0BTSUM1130841</IBMLFIELD3OF9>
<IBMLFORMNAME>BT-Summary page 3</IBMLFORMNAME>
<IMAGEFILENAME_1>D:\qmserver35\IMAGES\OUT\2012\01\17\08412011100002\10000004.tif</IMAGEFILENAME_1>
<IMAGEFILENAME_2>D:\qmserver35\IMAGES\OUT\2012\01\17\08412011100002\11000004.jpg</IMAGEFILENAME_2>
<IMAGEFILENAMECOLOR>11000004.jpg</IMAGEFILENAMECOLOR>
<IMAGESIDE>Front</IMAGESIDE>
<IMGFILENAME>10000004.tif</IMGFILENAME>
<PAGEDLN>08412011FFAX_435970002_0004</PAGEDLN>
<PAGEINDEX>6</PAGEINDEX>
<PCAERROR>0</PCAERROR>
<PCAPELAPSESECOND>3.92675912729464</PCAPELAPSESECOND>
<PDATACAPTURE>Y</PDATACAPTURE>
<PDATECAPTURE35>Image cannot be loaded: File D:\qmserver35\IMAGES\OUT\2012\01\17\08412011100002\10000004.tif is not found </PDATECAPTURE35>
<PDFAMTCOR>0</PDFAMTCOR>
<PDFAMTRAW>0</PDFAMTRAW>
<PFORMIDMETHOD/>
<PFORMTYPE>BTSUMMARY_2011_0841_P3</PFORMTYPE>
<PFORMTYPERAW>BTSUMMARY_2011_0841_P3</PFORMTYPERAW>
<PPAGENUM>7</PPAGENUM>
<PPAGETYPE>FORM</PPAGETYPE>
<PRETNUM>0</PRETNUM>
<PSCANLINE> </PSCANLINE>
<PSLERROR>0</PSLERROR>
<PSUBNUM>1</PSUBNUM>
<PSZAMTCOR/>
<PSZAMTRAW/>
</TOKEN>
<MIJ>
<POAFLG CONFIDENCE="1000">0</POAFLG>
<SIGNEDFLG CONFIDENCE="1000">1</SIGNEDFLG>
<SIGNSPSFLG CONFIDENCE="1000">0</SIGNSPSFLG>
<SIGNNAME CONFIDENCE="900">I </SIGNNAME>
<SIGNEMAIL CONFIDENCE="0"/>
<SIGNTELE CONFIDENCE="0"/>
<SURVSPSFLG CONFIDENCE="1000">0</SURVSPSFLG>
<PREPARNAME CONFIDENCE="0">JOHIU ?WV IM </PREPARNAME>
<PREPREMAIL CONFIDENCE="0"/>
<PREPRTELE CONFIDENCE="940">6032891065</PREPRTELE>
<PREPRID CONFIDENCE="166">133456725</PREPRID>
<STRADDR1 CONFIDENCE="0"/>
<STRADDR2 CONFIDENCE="0"/>
<CITY CONFIDENCE="891">PL EASANT ST </CITY>
<STATE CONFIDENCE="0"/>
<ZIPPSTLCD CONFIDENCE="0"/>
</MIJ>
</PAGE>
<PAGE PAGENUM="10">
<TOKEN>
<ARTIFICIAL_OCR>0</ARTIFICIAL_OCR>
<BARCODE>0BTSUM1130841</BARCODE>
<DOCID>4</DOCID>
<ERRORSTATUS/>
<IBMLFORMNAME>BT-Summary page 3</IBMLFORMNAME>
<IMAGEFILENAME_1>D:\qmserver35\IMAGES\OUT\2012\01\17\08412011100002\20000004.tif</IMAGEFILENAME_1>
<IMAGEFILENAME_2>D:\qmserver35\IMAGES\OUT\2012\01\17\08412011100002\21000004.jpg</IMAGEFILENAME_2>
<IMAGEFILENAMECOLOR>21000004.jpg</IMAGEFILENAMECOLOR>
<IMAGESIDE>Back</IMAGESIDE>
<IMGFILENAME>20000004.tif</IMGFILENAME>
<PAGEDLN>08412011FFAX_435970002_0004</PAGEDLN>
<PAGEINDEX>7</PAGEINDEX>
<PCAERROR>0</PCAERROR>
<PCAPELAPSESECOND>0.724592650716659</PCAPELAPSESECOND>
<PDATACAPTURE>Y</PDATACAPTURE>
<PDATECAPTURE35>Image cannot be loaded: File D:\qmserver35\IMAGES\OUT\2012\01\17\08412011100002\20000004.tif is not found </PDATECAPTURE35>
<PDFAMTCOR>0</PDFAMTCOR>
<PDFAMTRAW>0</PDFAMTRAW>
<PFORMIDMETHOD/>
<PFORMTYPE>ATTACHMENT</PFORMTYPE>
<PFORMTYPERAW>ATTACHMENT</PFORMTYPERAW>
<PPAGENUM>8</PPAGENUM>
<PPAGETYPE>FORM</PPAGETYPE>
<PRETNUM>0</PRETNUM>
<PSCANLINE> </PSCANLINE>
<PSLERROR>0</PSLERROR>
<PSUBNUM>1</PSUBNUM>
<PSZAMTCOR/>
<PSZAMTRAW/>
</TOKEN>
<MIJ>
<DUMMY CONFIDENCE="0"/>
</MIJ>
</PAGE>
</SUBMISSION>
</BATCH>




This is the Style Sheet I'm using.



<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" version="1.0" encoding="UTF-8"/>
<xsl:template match="/">
<xsl:apply-templates select="BATCH"/>
</xsl:template>
<xsl:template match="BATCH">
<BATCH>
<xsl:attribute name="PROCESSDATE"><xsl:value-of select="@PROCESSDATE"/></xsl:attribute>
<BATCHDIRPATH>
<xsl:value-of select="BATCHDIRPATH"/>
</BATCHDIRPATH>
<BATCHNUMBER>
<xsl:value-of select="BATCHNUMBER"/>
</BATCHNUMBER>
<BATCHSOURCE>
<xsl:value-of select="BATCHSOURCE"/>
</BATCHSOURCE>
<BATCHTYPE>
<xsl:value-of select="BATCHTYPE"/>
</BATCHTYPE>
<CREATEDATE>
<xsl:value-of select="CREATEDATE"/>
</CREATEDATE>
<DATERECIEVED>
<xsl:value-of select="DATERECEIVED"/>
</DATERECIEVED>
<DATESCANNED>
<xsl:value-of select="DATESCANNED"/>
</DATESCANNED>
<SCANNER>
<xsl:value-of select="IBMLSCANNERID"/>
</SCANNER>
<TAXYEAR>2011</TAXYEAR>
<xsl:for-each select="SUBMISSION">
<SUBMISSION>
<xsl:attribute name="SUBNUM"><xsl:value-of select="@SUBNUM"/></xsl:attribute>
<xsl:for-each select="PAGE">
<xsl:if test="TOKEN/PFORMTYPE = 'CHECK'">
<xsl:call-template name="CHECK"/>
</xsl:if>
<xsl:if test="contains(TOKEN/PFORMTYPE, 'BTSUMMARY')">
<xsl:if test="contains(TOKEN/PFORMTYPE, 'P1')">
<xsl:call-template name="BT-SUMMARY-P1"/>
</xsl:if>
<xsl:if test="contains(TOKEN/PFORMTYPE, 'P2')">
<xsl:call-template name="BT-SUMMARY-P2"/>
</xsl:if>
<xsl:if test="contains(TOKEN/PFORMTYPE, 'P3')">
<xsl:call-template name="BT-SUMMARY-P3"/>
</xsl:if>
</xsl:if>
</xsl:for-each>
</SUBMISSION>
</xsl:for-each>
</BATCH>
</xsl:template>
<xsl:template name="CHECK">
<PAGE>
<xsl:attribute name="PAGENUM"><xsl:value-of select="@PAGENUM"/></xsl:attribute>
<xsl:attribute name="LEAD">TRUE</xsl:attribute>
<TOKEN>
<SCNDLN>
<xsl:value-of select="TOKEN/PAGEDLN"/>
</SCNDLN>
<FORMTYPE>CHK</FORMTYPE>
<DEPDT>
<xsl:value-of select="TOKEN/DEPOSITDATE"/>
</DEPDT>
</TOKEN>
<MIJ>
<AMOUNT>
<xsl:value-of select="MIJ/CHECKAMOUNT"/>
</AMOUNT>
</MIJ>
</PAGE>
</xsl:template>
<xsl:template name="BT-SUMMARY-P1">
<PAGE>
<xsl:attribute name="PAGENUM"><xsl:value-of select="@PAGENUM"/></xsl:attribute>
<xsl:attribute name="LEAD">TRUE</xsl:attribute>
<TOKEN>
<SCNDLN>
<xsl:value-of select="TOKEN/PAGEDLN"/>
</SCNDLN>
<OFFSETSCANDLN>
<xsl:value-of select="TOKEN/OFFSETDLN"/>
</OFFSETSCANDLN>
<xsl:if test="TOKEN/COMBCB = 1">
<FORMID>BETLNGWE</FORMID>
<ENTITYTYP>6</ENTITYTYP>
</xsl:if>
<xsl:if test="TOKEN/PROPCB = 1">
<FORMID>BETPROP</FORMID>
<ENTITYTYP>1</ENTITYTYP>
</xsl:if>
<xsl:if test="TOKEN/PARTCB = 1">
<FORMID>BETLNG</FORMID>
<ENTITYTYP>3</ENTITYTYP>
</xsl:if>
<xsl:if test="TOKEN/NPCB = 1">
<FORMID>BETLNG</FORMID>
<ENTITYTYP>5</ENTITYTYP>
</xsl:if>
<xsl:if test="TOKEN/FIDCP = 1">
<FORMID>BETLNG</FORMID>
<ENTITYTYP>4</ENTITYTYP>
</xsl:if>
<xsl:if test="TOKEN/CORPCB = 1">
<FORMID>BETLNG</FORMID>
<ENTITYTYP>2</ENTITYTYP>
</xsl:if>
<FORMTYPE>RTN</FORMTYPE>
<FILEMETHOD>1</FILEMETHOD>
<ENTRYTYP>R</ENTRYTYP>
<SRCID>
<xsl:value-of select="TOKEN/SRCID"/>
</SRCID>
<TXPYREF>
<xsl:value-of select="MIJ/INDVIDNO1"/>
</TXPYREF>
</TOKEN>
<MIJ>
</MIJ>
</PAGE>
</xsl:template>
<xsl:template name="BT-SUMMARY-P2">
<PAGE>
<xsl:attribute name="PAGENUM"><xsl:value-of select="@PAGENUM"/></xsl:attribute>
<xsl:attribute name="LEAD">FALSE</xsl:attribute>
<TOKEN>
<SCNDLN>
<xsl:value-of select="TOKEN/PAGEDLN"/>
</SCNDLN>
<OFFSETSCANDLN>
<xsl:value-of select="TOKEN/OFFSETDLN"/>
</OFFSETSCANDLN>
<ENTRYTYP>R</ENTRYTYP>
<SRCID>
<xsl:value-of select="TOKEN/SRCID"/>
</SRCID>
</TOKEN>
<MIJ>
<BETAXAMTPD>
<xsl:value-of select="MIJ/CRSUB"/>
</BETAXAMTPD>
<BPTAXAMTPD>
<xsl:value-of select="MIJ/TAXNETSTCR"/>
</BPTAXAMTPD>
<INTPD>
<xsl:value-of select="MIJ/TOTINT"/>
</INTPD>
<LTPYMTCHRG>
<xsl:value-of select="MIJ/TOTFP"/>
</LTPYMTCHRG>
<LTFLNGFEE>
<xsl:value-of select="MIJ/TOTFF"/>
</LTFLNGFEE>
<UNDPYMTFEE>
<xsl:value-of select="MIJ/TOTUND"/>
</UNDPYMTFEE>
<TOTAMTPD>
<xsl:value-of select="MIJ/BALANCEDUE"/>
</TOTAMTPD>
<SPLCKPLUS>
(This is the value of all the checks - the balance due from this page.)
</SPLCKPLUS>
<SPLCKMINUS>
</SPLCKMINUS>
</MIJ>
</PAGE>
</xsl:template>
<xsl:template name="BT-SUMMARY-P3">
<PAGE>
<xsl:attribute name="PAGENUM"><xsl:value-of select="@PAGENUM"/></xsl:attribute>
<xsl:attribute name="LEAD">FALSE</xsl:attribute>
<TOKEN>
<SCNDLN>
<xsl:value-of select="TOKEN/PAGEDLN"/>
</SCNDLN>
<OFFSETSCANDLN>
<xsl:value-of select="TOKEN/OFFSETDLN"/>
</OFFSETSCANDLN>
<ENTRYTYP>R</ENTRYTYP>
<SRCID>
<xsl:value-of select="TOKEN/SRCID"/>
</SRCID>
</TOKEN>
<MIJ>
</MIJ>
</PAGE>
</xsl:template>
</xsl:stylesheet>



Can anyone please help me to get the total value of the AMOUNT tag for all the checks so I can use that value in other pages.

Thanks.

 

httpwebwitch

WebmasterWorld Administrator httpwebwitch us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4412081 posted 3:24 pm on Jan 30, 2012 (gmt 0)

>> so I can use that value in other pages

that's the key bit there; if you want that amount to be available on other pages, you'll need to store it somewhere (other than in this XML).

XSL is not the right tool for this job.

I'd parse this XML and put its contents in a database.

Then it's simple to write a SQL query that grabs the SUM() of a column

DevZero



 
Msg#: 4412081 posted 4:02 pm on Jan 30, 2012 (gmt 0)

Is there a way to write a function that will sum the values in XSLT?

Dijkgraaf

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4412081 posted 1:02 am on Jan 31, 2012 (gmt 0)

sum Function (XPath)
[msdn.microsoft.com...]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / XML Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved