Hi Michael.
Here's the XML file (I've removed the non pertinent elements).
Code:
<?xml version='1.0'?><!DOCTYPE doc SYSTEM 'xml_med7_dtd_2.0.54.dtd'>
<doc>
<EOB>
<VERSION>2.0.54</VERSION>
<TRCINFO>
<RCHEADER>FL Reduction Explanations:</RCHEADER>
<RCLINE>
<RCCODE>FL 90</RCCODE>
<RCEXPLANATION>
<LINE>Paid: no modification to the information</LINE>
<LINE>provided on the medical bill: payment made</LINE>
<LINE>pursuant to Florida Workers' Compensation Health</LINE>
<LINE>Care Provider Reimbursement Manual.</LINE>
</RCEXPLANATION>
</RCLINE>
</TRCINFO>
<CRCSTATERCINFO>
<RCLINE>
<RCCODE>FL 92</RCCODE>
<RCEXPLANATION>
<LINE>Paid: no modification to the information</LINE>
<LINE>provided on the medical bill: payment made</LINE>
<LINE>pursuant to Florida Workers' Compensation</LINE>
<LINE>Reimbursement Manual for Hospitals.</LINE>
</RCEXPLANATION>
</RCLINE>
<RCLINE>
<RCCODE>FL 90</RCCODE>
<RCEXPLANATION>
<LINE>Paid: no modification to the information</LINE>
<LINE>provided on the medical bill: payment made</LINE>
<LINE>pursuant to Florida Workers' Compensation Health</LINE>
<LINE>Care Provider Reimbursement Manual.</LINE>
</RCEXPLANATION>
</RCLINE>
</CRCSTATERCINFO>
</EOB>
</doc>
Here's my XSLT code that processes the <CRCSTATERCINFO> element.
I've included Rummy's suggestion which only works if there is one TRCINFO/RCLINE/RCCODE. I've also left out the table formatting code.
Code:
<xsl:if test="EOB/CRCSTATERCINFO/RCLINE[descendant::RCEXPLANATION/LINE!='']">
<fo:block>
<xsl:apply-templates select="EOB/CRCSTATERCINFO"/>
</fo:block>
</xsl:if>
<xsl:template match="CRCSTATERCINFO">
<fo:table-body>
<xsl:for-each select="RCLINE">
<xsl:variable name="trccodes" select="/doc/EOB/TRCINFO/RCLINE/RCCODE" />
<xsl:if test="RCCODE[.!=$trccodes]">
<xsl:value-of select="RCCODE"/>
Here's the current output.
FL 90 Paid: no modification to the information etc.
(from TRCINFO/RCLINE/RCEXPLANATION)
FL 92 Paid: no modification to the information etc.
(from CRCSTATERCINFO/RCLINE/RCEXPLANATION)
FL 90 Paid: no modification to the information etc.
(from CRCSTATERCINFO/RCLINE/RCEXPLANATION)
Here's what I need to output.
FL 90 Paid: no modification to the information etc.
(from TRCINFO/RCLINE/RCEXPLANATION)
FL 92 Paid: no modification to the information etc.
(from CRCSTATERCINFO/RCLINE/RCEXPLANATION)
Don't print the second "FL 90" line (from CRCSTATERCINFO/RCLINE/RCEXPLANATION) since it's the same as that from TRCINFO/RCLINE/RCEXPLANATION.
I'm not showing the code to print the TRCINFO/RCLINE/RCEXPLANATION code since it's pretty straight foreward and justs prints whateve is in the RCEXPLANATION lines.
Just a quick note - for the XML info supplied here, my code works but if there are two <TRCINFO> elements and the "FL 90" was in the second one, it does not work!
Thanks for all your help!
Rita