Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6894687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:48:50+00:00 2026-05-27T06:48:50+00:00

I’m not sure if this is even possible but here we go. I have

  • 0

I’m not sure if this is even possible but here we go.

I have an xml file:

<ROOT>
  <MEM-STMT>   
    <COUNTRY>co</COUNTRY>   
    <CURRENCY>cu</CURRENCY>   
    <STMT>   
      <ST-NO>1</ST-NO>   
      <ST-DATE>21-JUL-11</ST-DATE>   
      <CC>21</CC>   
      <YY>11</YY>   
      <MM>07</MM>   
      <DD>21</DD>   
    </STMT>   
    <MEM-DET>   
      <MEM-NO>9</MEM-NO>   
      <MEM-PROD-LEV>24</MEM-PROD-LEV>   
      <MEM-OPTION>option</MEM-OPTION>   
      <MEM-EMP-NO/>   
      <MEM-EMP-NAME>name</MEM-EMP-NAME>   
    </MEM-DET>   
    <MEM-ADDR>   
      <MEM-NAME>name</MEM-NAME>   
      <MEM-ADDR1>                  Addr1</MEM-ADDR1>   
      <MEM-ADDR2>                           Addr2</MEM-ADDR2>   
      <MEM-ADDR3>                         Addr3</MEM-ADDR3>   
      <MEM-SUB>                            Sub</MEM-SUB>   
      <MEM-CITY>                          +2</MEM-CITY>   
      <MEM-REG>                   Employer:reg</MEM-REG>   
      <MEM-CNTRY/>   
      <MEM-PCODE/>   
      <MEM-EMPCODE/>   
    </MEM-ADDR>   
    <ACC>   
      <PROV>   
        <PR-NO>1</PR-NO>   
        <PR-NAME>  pr</PR-NAME>   
        <REF-NO>1</REF-NO>   
        <CLM>   
          <REF>1</REF>   
          <CL-DEP-NO>04</CL-DEP-NO>   
          <CL-DEP-NAME>dep</CL-DEP-NAME>   
          <CL-DOS>10-APR-11</CL-DOS>   
          <CC>21</CC>   
          <YY>11</YY>   
          <MM>04</MM>   
          <DD>10</DD>   
          <CL-TAR-DRUG-CD>1 </CL-TAR-DRUG-CD>   
          <CL-TAR-DRUG-DESC>desc </CL-TAR-DRUG-DESC>   
          <CL-NO>1</CL-NO>   
          <CL-LINE>2</CL-LINE>   
          <CL-AMT>16.8</CL-AMT>   
          <CL-TAR-AMT>16.8</CL-TAR-AMT>   
          <CL-PAID-PROV>16.8</CL-PAID-PROV>   
          <CL-PAID-MEM>0</CL-PAID-MEM>   
          <CL-RSN/>   
        </CLM>   
        <CLM>   
          <REF>1</REF>   
          <CL-DEP-NO>04</CL-DEP-NO>   
          <CL-DEP-NAME>dep </CL-DEP-NAME>   
          <CL-DOS>20-APR-11</CL-DOS>   
          <CC>21</CC>   
          <YY>11</YY>   
          <MM>04</MM>   
          <DD>20</DD>   
          <CL-TAR-DRUG-CD>1 </CL-TAR-DRUG-CD>   
          <CL-TAR-DRUG-DESC>desc </CL-TAR-DRUG-DESC>   
          <CL-NO>1</CL-NO>   
          <CL-LINE>2</CL-LINE>   
          <CL-AMT>50.4</CL-AMT>   
          <CL-TAR-AMT>50.4</CL-TAR-AMT>   
          <CL-PAID-PROV>50.4</CL-PAID-PROV>   
          <CL-PAID-MEM>0</CL-PAID-MEM>   
          <CL-RSN/>   
        </CLM>   
        <TOTALS>   
          <TOT-AMT>67.2</TOT-AMT>   
          <TOT-TAR-AMT>67.2</TOT-TAR-AMT>   
          <TOT-PAID-PROV>67.2</TOT-PAID-PROV>   
          <TOT-PAID-MEM>0</TOT-PAID-MEM>   
        </TOTALS>   
      </PROV>   
      <PROV>   
        <PR-NO>2</PR-NO>   
        <PR-NAME>  pr</PR-NAME>   
        <REF-NO>1</REF-NO>   
        <CLM>   
          <REF>1</REF>   
          <CL-DEP-NO>04</CL-DEP-NO>   
          <CL-DEP-NAME>dep</CL-DEP-NAME>   
          <CL-DOS>10-APR-11</CL-DOS>   
          <CC>21</CC>   
          <YY>11</YY>   
          <MM>04</MM>   
          <DD>10</DD>   
          <CL-TAR-DRUG-CD>1</CL-TAR-DRUG-CD>   
          <CL-TAR-DRUG-DESC>desc </CL-TAR-DRUG-DESC>   
          <CL-NO>1</CL-NO>   
          <CL-LINE>2</CL-LINE>   
          <CL-AMT>15</CL-AMT>   
          <CL-TAR-AMT>0</CL-TAR-AMT>   
          <CL-PAID-PROV>15</CL-PAID-PROV>   
          <CL-PAID-MEM>0</CL-PAID-MEM>   
          <CL-RSN/>   
        </CLM>   
        <TOTALS>   
          <TOT-AMT>15</TOT-AMT>   
          <TOT-TAR-AMT>0</TOT-TAR-AMT>   
          <TOT-PAID-PROV>15</TOT-PAID-PROV>   
          <TOT-PAID-MEM>0</TOT-PAID-MEM>   
        </TOTALS>   
      </PROV>   
      <PROV>   
        <PR-NO>1</PR-NO>   
        <PR-NAME>  pr</PR-NAME>   
        <REF-NO>I0428202</REF-NO>   
        <CLM>   
          <REF>I0428202</REF>   
          <CL-DEP-NO>03</CL-DEP-NO>   
          <CL-DEP-NAME>dep</CL-DEP-NAME>   
          <CL-DOS>10-APR-11</CL-DOS>   
          <CC>21</CC>   
          <YY>11</YY>   
          <MM>04</MM>   
          <DD>10</DD>   
          <CL-TAR-DRUG-CD>2</CL-TAR-DRUG-CD>   
          <CL-TAR-DRUG-DESC>desc</CL-TAR-DRUG-DESC>   
          <CL-NO>112153</CL-NO>   
          <CL-LINE>217615</CL-LINE>   
          <CL-AMT>31.58</CL-AMT>   
          <CL-TAR-AMT>0</CL-TAR-AMT>   
          <CL-PAID-PROV>31.58</CL-PAID-PROV>   
          <CL-PAID-MEM>0</CL-PAID-MEM>   
          <CL-RSN/>   
        </CLM>   
        <TOTALS>   
          <TOT-AMT>31.58</TOT-AMT>   
          <TOT-TAR-AMT>0</TOT-TAR-AMT>   
          <TOT-PAID-PROV>31.58</TOT-PAID-PROV>   
          <TOT-PAID-MEM>0</TOT-PAID-MEM>   
        </TOTALS>   
      </PROV>   
      <PROV>   
        <PR-NO>1</PR-NO>   
        <PR-NAME> pr</PR-NAME>   
        <REF-NO>0027579</REF-NO>   
        <CLM>   
          <REF>1</REF>   
          <CL-DEP-NO>04</CL-DEP-NO>   
          <CL-DEP-NAME>dep</CL-DEP-NAME>   
          <CL-DOS>09-JUN-11</CL-DOS>   
          <CC>21</CC>   
          <YY>11</YY>   
          <MM>06</MM>   
          <DD>09</DD>   
          <CL-TAR-DRUG-CD>99200 </CL-TAR-DRUG-CD>   
          <CL-TAR-DRUG-DESC>desc</CL-TAR-DRUG-DESC>   
          <CL-NO>1</CL-NO>   
          <CL-LINE>1</CL-LINE>   
          <CL-AMT>12</CL-AMT>   
          <CL-TAR-AMT>0</CL-TAR-AMT>   
          <CL-PAID-PROV>12</CL-PAID-PROV>   
          <CL-PAID-MEM>0</CL-PAID-MEM>   
          <CL-RSN/>   
        </CLM>   
        <TOTALS>   
          <TOT-AMT>12</TOT-AMT>   
          <TOT-TAR-AMT>0</TOT-TAR-AMT>   
          <TOT-PAID-PROV>12</TOT-PAID-PROV>   
          <TOT-PAID-MEM>0</TOT-PAID-MEM>   
        </TOTALS>   
      </PROV>   
    </ACC>   
    <RSN-LIST>   
      <RSN-ERR>????</RSN-ERR>   
      <RSN-DESC/>   
    </RSN-LIST>   
    <FIN-OTHER>   
      <FIN-DATE/>   
      <FIN-AMT>0</FIN-AMT>   
      <FIN-TT/>   
    </FIN-OTHER>   
    <GTOTALS>   
      <GTOT-AMT>125.78</GTOT-AMT>   
      <GTOT-TAR-AMT>67.2</GTOT-TAR-AMT>   
      <GTOT-PAID-PROV>125.78</GTOT-PAID-PROV>   
      <GTOT-PAID-MEM>0</GTOT-PAID-MEM>   
    </GTOTALS>   
    <MEM-GTOT>   
      <M-MESSAGE/>   
      <M-TOT-PAID-MEM>0</M-TOT-PAID-MEM>   
      <M-PMT-METH/>   
    </MEM-GTOT>   
    <FIN-BAL>   
      <FIN-BDATE>21-JUL-11</FIN-BDATE>   
      <FIN-BAMT>0</FIN-BAMT>   
      <FIN-BTT/>   
    </FIN-BAL>   
  </MEM-STMT>   
</ROOT> 

& I’d like to split the records returned from it using the logic below:

If the xml file has 30 or more PROV-or-CLM-or-TOTATALS nodes then process only 30 PROV-or-CLM-or-TOTATALS nodes. Do this for the entire xml file in case where the number of remaining nodes is less than 30 process them to complete the transformation.

I’m using the following xsl to do this:

<xsl:template name="PROVIDER">
<fo:page-sequence master-reference="global">
<fo:flow flow-name="xsl-region-body">
<fo:wrapper font-size="7pt" font-family="Helvetica">
<fo:block-container >
<xsl:variable name="CURRENCYSYMBOL"><xsl:value-of select="ROOT/MEM-STMT/CURRENCY"/></xsl:variable>
<xsl:for-each select="ROOT/MEM-STMT/ACC/PROV">
<xsl:if test="(position() mod 30 = 1)">
<fo:block >
    <fo:table table-layout="fixed" width="190mm" border-style="solid">
    <fo:table-column column-width="22mm"/>
    <fo:table-column column-width="16mm"/>
    <fo:table-column column-width="18mm"/>
    <fo:table-column column-width="39mm"/>
<!--    <fo:table-column column-width="15mm"/>  -->
    <fo:table-column column-width="20mm"/>
    <fo:table-column column-width="20mm"/>
    <fo:table-column column-width="20mm"/>
    <fo:table-column column-width="20mm"/>
    <fo:table-column column-width="15mm"/>

    <fo:table-header border="solid" >
        <fo:table-row  border-style="solid">
        <fo:table-cell  background-color="{$HeaderGray}" number-columns-spanned="9" padding="2pt">
            <fo:block font-size="7pt" text-align="left" font-weight="bold">Provider:
            <xsl:value-of select="PR-NO"/>-
            <xsl:value-of select="PR-NAME"/>
            <xsl:text>&#xA0;  </xsl:text>  Ref No:
            <xsl:value-of select="REF-NO"/>
            </fo:block>
        </fo:table-cell>
        </fo:table-row>

        <fo:table-row border-style="solid">
        <fo:table-cell border-style="solid" padding="2pt">
            <fo:block text-align="center" font-weight="bold">Patient</fo:block>
        </fo:table-cell>
        <fo:table-cell border-style="solid" padding="2pt">
            <fo:block text-align="center" font-weight="bold">Serv Date</fo:block>
        </fo:table-cell>
        <fo:table-cell border-style="solid" padding="2pt">
            <fo:block text-align="center" font-weight="bold">Tariff/Drug</fo:block>
        </fo:table-cell>
        <fo:table-cell border-style="solid" padding="2pt">
            <fo:block text-align="center" font-weight="bold">Description</fo:block>
        </fo:table-cell>
    <!--    <fo:table-cell border-style="solid" padding="2pt">
            <fo:block text-align="center" font-weight="bold">Claim No</fo:block>
        </fo:table-cell>     -->
        <fo:table-cell border-style="solid" padding="2pt">
            <fo:block text-align="center" font-weight="bold">Claim Amount</fo:block>
        </fo:table-cell>
        <fo:table-cell border-style="solid" padding="2pt">
            <fo:block text-align="center" font-weight="bold">Tariff Amount</fo:block>
        </fo:table-cell>
        <fo:table-cell border-style="solid" padding="2pt">
            <fo:block text-align="center" font-weight="bold">Paid Provider</fo:block>
        </fo:table-cell>
        <fo:table-cell border-style="solid" padding="2pt">
            <fo:block text-align="center" font-weight="bold">Paid Member</fo:block>
        </fo:table-cell>
        <fo:table-cell border-style="solid" padding="2pt">
            <fo:block text-align="center" font-weight="bold">Reason</fo:block>
        </fo:table-cell>
        </fo:table-row>
    </fo:table-header>

<xsl:for-each select="./CLM">
    <xsl:if test="(position() mod 30 = 1)"> 
    <fo:table-body font-size="7pt">
    <fo:table-row>

        <fo:table-cell padding="2pt" >
            <fo:block>
            <xsl:value-of select="CL-DEP-NAME"/><xsl:text>&#xA0;  </xsl:text>
            <xsl:value-of select="CL-DEP-NO"/>
            </fo:block>
        </fo:table-cell>
        <fo:table-cell padding="2pt" >
            <fo:block>
            <xsl:value-of select="CL-DOS"/>
            </fo:block>
        </fo:table-cell>
        <fo:table-cell padding="2pt" >
            <fo:block>
            <xsl:value-of select="CL-TAR-DRUG-CD"/>
            </fo:block>
        </fo:table-cell>

        <fo:table-cell padding="2pt" >
            <fo:block>
            <xsl:value-of select="CL-TAR-DRUG-DESC"/>
            </fo:block>
        </fo:table-cell>
    <!--    <fo:table-cell padding="2pt">
            <fo:block>
            <xsl:value-of select="CL-NO"/>
            </fo:block>
        </fo:table-cell>  -->
        <fo:table-cell padding="2pt">
            <fo:block text-align="right">
            <xsl:if test="CL-AMT != '0'">
                <xsl:value-of select="$CURRENCYSYMBOL"/>
                <xsl:value-of select="format-number(CL-AMT,'#,##0.00')"/>
            </xsl:if>
            </fo:block>
        </fo:table-cell>
        <fo:table-cell padding="2pt">
            <fo:block text-align="right">
            <xsl:if test="CL-TAR-AMT != '0'">
                <xsl:value-of select="$CURRENCYSYMBOL"/>
                <xsl:value-of select="format-number(CL-TAR-AMT,'#,##0.00')"/>
            </xsl:if>
            </fo:block>
        </fo:table-cell>
        <fo:table-cell padding="2pt" >
            <fo:block text-align="right">
            <xsl:if test="CL-PAID-PROV != '0'">
                <xsl:value-of select="$CURRENCYSYMBOL"/>
                <xsl:value-of select="format-number(CL-PAID-PROV,'#,##0.00')"/>
            </xsl:if>
            </fo:block>
        </fo:table-cell>
        <fo:table-cell padding="2pt">
            <fo:block text-align="right">
            <xsl:if test="CL-PAID-MEM != '0'">
                <xsl:value-of select="$CURRENCYSYMBOL"/>
                <xsl:value-of select="format-number(CL-PAID-MEM,'#,##0.00')"/>
            </xsl:if>
            </fo:block>
        </fo:table-cell>
        <fo:table-cell padding="2pt">
            <fo:block text-align="right">
                <xsl:if test="CL-RSN != '????'">
                    <xsl:value-of select="CL-RSN"/>
                </xsl:if>
            </fo:block>
        </fo:table-cell>

    </fo:table-row>
    </fo:table-body>
    </xsl:if>
    </xsl:for-each>

    <xsl:for-each select="./TOTALS">
    <xsl:if test="(position() mod 30 = 1)">
    <fo:table-body font-size="7pt">

    <fo:table-row border-style="solid">

        <fo:table-cell padding="2pt" number-columns-spanned="4" >
            <fo:block >Totals for Invoice</fo:block>
        </fo:table-cell>

        <fo:table-cell padding="2pt" >
            <fo:block text-align="right">
        <!--    <xsl:if test="TOT-AMT != '0'">       -->
                <xsl:value-of select="$CURRENCYSYMBOL"/>
                <xsl:value-of select="format-number(TOT-AMT,'#,##0.00')"/>
        <!--    </xsl:if>     -->
            </fo:block>
        </fo:table-cell >
        <fo:table-cell padding="2pt">
            <fo:block text-align="right">
        <!--    <xsl:if test="TOT-TAR-AMT != '0'">  -->
                <xsl:value-of select="$CURRENCYSYMBOL"/>
                <xsl:value-of select="format-number(TOT-TAR-AMT,'#,##0.00')"/>
        <!--    </xsl:if>    -->
            </fo:block>
        </fo:table-cell>
        <fo:table-cell padding="2pt">
            <fo:block text-align="right">
        <!--    <xsl:if test="TOT-PAID-PROV != '0'">    -->
                <xsl:value-of select="$CURRENCYSYMBOL"/>
                <xsl:value-of select="format-number(TOT-PAID-PROV,'#,##0.00')"/>
        <!--    </xsl:if>    -->
            </fo:block>
        </fo:table-cell>
        <fo:table-cell padding="2pt">
            <fo:block text-align="right">
        <!--    <xsl:if test="TOT-PAID-MEM != '0'">   -->
                <xsl:value-of select="$CURRENCYSYMBOL"/>
                <xsl:value-of select="format-number(TOT-PAID-MEM,'#,##0.00')"/>
        <!--    </xsl:if>   -->
            </fo:block>
        </fo:table-cell>
        <fo:table-cell >
            <fo:block>

            </fo:block>
        </fo:table-cell>
    </fo:table-row>
    </fo:table-body>
    </xsl:if>
    </xsl:for-each>
    </fo:table>
</fo:block>
</xsl:if>
</xsl:for-each>
</fo:block-container>
</fo:wrapper>
</fo:flow>
</fo:page-sequence>

My current scenario is such that the split doesn’t work & I get the exception: Exception in thread “AWT-EventQueue-2” java.lang.OutOfMemoryError: Java heap space despite allocating -Xms/-Xmx2G memory.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:48:51+00:00Added an answer on May 27, 2026 at 6:48 am

    Kamza, you had part of it right, but there are a few flaws in your approach. You start with a for-each on PROV elements, and within the for-each you have an if that causes output to be written only for PROV elements 1, 31, 61, etc. The nested for-each loops have a similar problem. Only CLM element 1, 31, 61, .. is written, like only TOTALS 1, 31, 61, ..

    (Actually, I suspect there will only be one TOTALS within each PROV, so that would ok in your code.)

    Furthermore, from what I understand from your description and the comments is that you are trying to write out 30 rows at a time, and start a new table, or even a new page after that, with another 30 rows, or what is left. Since no rows are written for the PROV element itself, I presume that it is just about CLM and TOTALS rows, where the count of 30 should include both.

    What you need for that is an outer for-each loop that walks along all CLM and TOTALS elements. You can use this expression for that:

        <xsl:for-each select="ROOT/MEM-STMT/ACC/PROV/*[self::CLM or self::TOTALS]">
    

    Then use the if you already have to create a new table for row 1, 31, 61, …

    To fill the table with the first-next 30 items, you will need to look forward 30 positions. The PROV element is a bit of a problem here. Assuming CLM and TOTALS only occur within PROV, and PROV is not used elsewhere, you can reasonably safely use the following axis for that:

        <xsl:for-each select="(following::*[self::CLM or self::TOTALS])[30 >= position()]">
    

    That returns 30 items, both CLM and TOTALS mixed, but in document order. You need two extra if’s (or a choose) to distinguish between these two, and output the appropriate table row:

        <xsl:if test="self::CLM">
            ...
        </xsl:if>
        <xsl:if test="self::TOTALS">
            ...
        </xsl:if>
    

    In your code you have fo:table-body within the inner for-each loops, causing each table-row to be wrapped in a new table-body. That is unnecessary. Move the table-body to outside the inner loops. You would need only one wrapping both rows of CLM and TOTALS.

    Finally, you write a new table for each 30th item. I think you want to start a new page-sequence as well. That will cause each table to be shown on a separate page. Putting things together, you get an XSLT similar to this:

    <?xml version="1.0" encoding="utf-8"?> 
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:fo="http://www.w3.org/1999/XSL/Format">
    
        <xsl:variable name="HeaderGray" select="'gray'"/>
    
        <xsl:template match="/">
            <fo:root>
                <fo:layout-master-set>
                    <fo:simple-page-master master-name="global">
                        <fo:region-body/>
                    </fo:simple-page-master>
                </fo:layout-master-set>
    
                <xsl:apply-templates select="/" mode="PROVIDER"/>
    
            </fo:root>
        </xsl:template>
    
        <xsl:template match="/" mode="PROVIDER">
            <xsl:variable name="CURRENCYSYMBOL" select="string(ROOT/MEM-STMT/CURRENCY)"/>
    
            <xsl:for-each select="ROOT/MEM-STMT/ACC/PROV/*[self::CLM or self::TOTALS]">
                <xsl:if test="position() mod 30 = 1">
    
                    <fo:page-sequence master-reference="global">
                        <fo:flow flow-name="xsl-region-body">
                            <fo:wrapper font-size="7pt" font-family="Helvetica">
                                <fo:block-container>
                                    <fo:block>
                                        <fo:table table-layout="fixed" width="190mm"
                                            border-style="solid">
                                            <fo:table-column column-width="22mm"/>
                                            <fo:table-column column-width="16mm"/>
                                            <fo:table-column column-width="18mm"/>
                                            <fo:table-column column-width="39mm"/>
                                            <!--    <fo:table-column column-width="15mm"/>  -->
                                            <fo:table-column column-width="20mm"/>
                                            <fo:table-column column-width="20mm"/>
                                            <fo:table-column column-width="20mm"/>
                                            <fo:table-column column-width="20mm"/>
                                            <fo:table-column column-width="15mm"/>
    
                                            <fo:table-header border="solid">
                                                <fo:table-row border-style="solid">
                                                    <fo:table-cell background-color="{$HeaderGray}"
                                                      number-columns-spanned="9" padding="2pt">
                                                      <fo:block font-size="7pt" text-align="left"
                                                      font-weight="bold">Provider: <xsl:value-of
                                                      select="PR-NO"/>- <xsl:value-of select="PR-NAME"/>
                                                      <xsl:text>&#xA0;  </xsl:text> Ref No:
                                                      <xsl:value-of select="REF-NO"/>
                                                      </fo:block>
                                                    </fo:table-cell>
                                                </fo:table-row>
    
                                                <fo:table-row border-style="solid">
                                                    <fo:table-cell border-style="solid" padding="2pt">
                                                      <fo:block text-align="center" font-weight="bold"
                                                      >Patient</fo:block>
                                                    </fo:table-cell>
                                                    <fo:table-cell border-style="solid" padding="2pt">
                                                      <fo:block text-align="center" font-weight="bold"
                                                      >Serv Date</fo:block>
                                                    </fo:table-cell>
                                                    <fo:table-cell border-style="solid" padding="2pt">
                                                      <fo:block text-align="center" font-weight="bold"
                                                      >Tariff/Drug</fo:block>
                                                    </fo:table-cell>
                                                    <fo:table-cell border-style="solid" padding="2pt">
                                                      <fo:block text-align="center" font-weight="bold"
                                                      >Description</fo:block>
                                                    </fo:table-cell>
                                                    <!--    <fo:table-cell border-style="solid" padding="2pt"> 
                <fo:block text-align="center" font-weight="bold">Claim No</fo:block> 
            </fo:table-cell>     -->
                                                    <fo:table-cell border-style="solid" padding="2pt">
                                                      <fo:block text-align="center" font-weight="bold"
                                                      >Claim Amount</fo:block>
                                                    </fo:table-cell>
                                                    <fo:table-cell border-style="solid" padding="2pt">
                                                      <fo:block text-align="center" font-weight="bold"
                                                      >Tariff Amount</fo:block>
                                                    </fo:table-cell>
                                                    <fo:table-cell border-style="solid" padding="2pt">
                                                      <fo:block text-align="center" font-weight="bold"
                                                      >Paid Provider</fo:block>
                                                    </fo:table-cell>
                                                    <fo:table-cell border-style="solid" padding="2pt">
                                                      <fo:block text-align="center" font-weight="bold"
                                                      >Paid Member</fo:block>
                                                    </fo:table-cell>
                                                    <fo:table-cell border-style="solid" padding="2pt">
                                                      <fo:block text-align="center" font-weight="bold"
                                                      >Reason</fo:block>
                                                    </fo:table-cell>
                                                </fo:table-row>
                                            </fo:table-header>
    
                                            <fo:table-body font-size="7pt">
                                                <xsl:for-each
                                                select="(following::*[self::CLM or self::TOTALS])[30 >= position()]">
                                                <xsl:if test="self::CLM">
                                                      <fo:table-row>
    
                                                      <fo:table-cell padding="2pt">
                                                      <fo:block>
                                                      <xsl:value-of select="CL-DEP-NAME"/>
                                                      <xsl:text>&#xA0;  </xsl:text>
                                                      <xsl:value-of select="CL-DEP-NO"/>
                                                      </fo:block>
                                                      </fo:table-cell>
                                                      <fo:table-cell padding="2pt">
                                                      <fo:block>
                                                      <xsl:value-of select="CL-DOS"/>
                                                      </fo:block>
                                                      </fo:table-cell>
                                                      <fo:table-cell padding="2pt">
                                                      <fo:block>
                                                      <xsl:value-of select="CL-TAR-DRUG-CD"/>
                                                      </fo:block>
                                                      </fo:table-cell>
    
                                                      <fo:table-cell padding="2pt">
                                                      <fo:block>
                                                      <xsl:value-of select="CL-TAR-DRUG-DESC"/>
                                                      </fo:block>
                                                      </fo:table-cell>
                                                      <!--    <fo:table-cell padding="2pt"> 
                <fo:block> 
                <xsl:value-of select="CL-NO"/> 
                </fo:block> 
            </fo:table-cell>  -->
                                                      <fo:table-cell padding="2pt">
                                                      <fo:block text-align="right">
                                                      <xsl:if test="CL-AMT != '0'">
                                                      <xsl:value-of select="$CURRENCYSYMBOL"/>
                                                      <xsl:value-of
                                                      select="format-number(CL-AMT,'#,##0.00')"/>
                                                      </xsl:if>
                                                      </fo:block>
                                                      </fo:table-cell>
                                                      <fo:table-cell padding="2pt">
                                                      <fo:block text-align="right">
                                                      <xsl:if test="CL-TAR-AMT != '0'">
                                                      <xsl:value-of select="$CURRENCYSYMBOL"/>
                                                      <xsl:value-of
                                                      select="format-number(CL-TAR-AMT,'#,##0.00')"/>
                                                      </xsl:if>
                                                      </fo:block>
                                                      </fo:table-cell>
                                                      <fo:table-cell padding="2pt">
                                                      <fo:block text-align="right">
                                                      <xsl:if test="CL-PAID-PROV != '0'">
                                                      <xsl:value-of select="$CURRENCYSYMBOL"/>
                                                      <xsl:value-of
                                                      select="format-number(CL-PAID-PROV,'#,##0.00')"/>
                                                      </xsl:if>
                                                      </fo:block>
                                                      </fo:table-cell>
                                                      <fo:table-cell padding="2pt">
                                                      <fo:block text-align="right">
                                                      <xsl:if test="CL-PAID-MEM != '0'">
                                                      <xsl:value-of select="$CURRENCYSYMBOL"/>
                                                      <xsl:value-of
                                                      select="format-number(CL-PAID-MEM,'#,##0.00')"/>
                                                      </xsl:if>
                                                      </fo:block>
                                                      </fo:table-cell>
                                                      <fo:table-cell padding="2pt">
                                                      <fo:block text-align="right">
                                                      <xsl:if test="CL-RSN != '????'">
                                                      <xsl:value-of select="CL-RSN"/>
                                                      </xsl:if>
                                                      </fo:block>
                                                      </fo:table-cell>
    
                                                      </fo:table-row>
                                                </xsl:if>
                                                <xsl:if test="self::TOTALS">
    
                                                      <fo:table-row border-style="solid">
    
                                                      <fo:table-cell padding="2pt"
                                                      number-columns-spanned="4">
                                                      <fo:block>Totals for Invoice</fo:block>
                                                      </fo:table-cell>
    
                                                      <fo:table-cell padding="2pt">
                                                      <fo:block text-align="right">
                                                      <!--    <xsl:if test="TOT-AMT != '0'">       -->
                                                      <xsl:value-of select="$CURRENCYSYMBOL"/>
                                                      <xsl:value-of
                                                      select="format-number(TOT-AMT,'#,##0.00')"/>
                                                      <!--    </xsl:if>     -->
                                                      </fo:block>
                                                      </fo:table-cell>
                                                      <fo:table-cell padding="2pt">
                                                      <fo:block text-align="right">
                                                      <!--    <xsl:if test="TOT-TAR-AMT != '0'">  -->
                                                      <xsl:value-of select="$CURRENCYSYMBOL"/>
                                                      <xsl:value-of
                                                      select="format-number(TOT-TAR-AMT,'#,##0.00')"/>
                                                      <!--    </xsl:if>    -->
                                                      </fo:block>
                                                      </fo:table-cell>
                                                      <fo:table-cell padding="2pt">
                                                      <fo:block text-align="right">
                                                      <!--    <xsl:if test="TOT-PAID-PROV != '0'">    -->
                                                      <xsl:value-of select="$CURRENCYSYMBOL"/>
                                                      <xsl:value-of
                                                      select="format-number(TOT-PAID-PROV,'#,##0.00')"/>
                                                      <!--    </xsl:if>    -->
                                                      </fo:block>
                                                      </fo:table-cell>
                                                      <fo:table-cell padding="2pt">
                                                      <fo:block text-align="right">
                                                      <!--    <xsl:if test="TOT-PAID-MEM != '0'">   -->
                                                      <xsl:value-of select="$CURRENCYSYMBOL"/>
                                                      <xsl:value-of
                                                      select="format-number(TOT-PAID-MEM,'#,##0.00')"/>
                                                      <!--    </xsl:if>   -->
                                                      </fo:block>
                                                      </fo:table-cell>
                                                      <fo:table-cell>
                                                      <fo:block> </fo:block>
                                                      </fo:table-cell>
                                                      </fo:table-row>
                                                </xsl:if>
                                            </xsl:for-each>
                                            </fo:table-body>
                                        </fo:table>
                                    </fo:block>
    
                                </fo:block-container>
                            </fo:wrapper>
                        </fo:flow>
                    </fo:page-sequence>
                </xsl:if>
            </xsl:for-each>
    
        </xsl:template>
    </xsl:stylesheet>
    

    Note: I am not entirely convinced this will prevent you from getting an exception. You gave the impression it is because of your for-each loops, but it may be caused by something else. A table that is simply to big, or an fo document that is too large to render might be the cause as well, for instance. The above code should be fairly efficient. If it is still giving you trouble, try processing things from the command-line, perhaps even using different parsers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
This could be a duplicate question, but I have no idea what search terms
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
In my XML file chapters tag has more chapter tag.i need to display chapters
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.