Hello.
I have the following XML code:
Code:
<CRCDATA>
<CRCDATALINE>
<CRC>SOM2</CRC>
<PDFPRINT>N</PDFPRINT>
<CRCSTATERC>G57</CRCSTATERC>
</CRCDATALINE>
<CRCDATALINE>
<CRC>SOM5</CRC>
<PDFPRINT>Y</PDFPRINT>
<CRCSTATERC>G57</CRCSTATERC>
</CRCDATALINE>
</CRCDATA>
I need to print all <CRCSTATERC> where <PDFPRINT>Y and <CRCSTATERC> not equal to the <CRCSTATERC> in a parent tag.
In my XML code this would be "G57" from the second <CRCDATALINE>.
I have the following XSLT code:
Code:
<xsl:for-each select="CRCDATA/CRCDATALINE">
<xsl:if test="CRCSTATERC!='' and (PDFPRINT='Y' or not(PDFPRINT))">
<xsl:if test="not(CRCSTATERC[.=parent::*/preceding-sibling::*/CRCSTATERC]) and HERE'S WHERE I'M STUCK!">
<xsl:value-of select="CRCSTATERC"/>
</xsl:if>
</xsl:if>
</xsl:for-each>
I don't know how to code the second test (HERE'S WHERE I'M STUCK!) to see if the same position of <PDFPRINT> (in the first occurrence of <CRCDATALINE>) is Y. If it is Y, then I would not print the second "G57". If it's N, then second "G57" would print. How would I allow <PDFPRINT> to not be present (as in older versions of my XML files)?
Any help will be greatly appreciated!
Thanks,
Rita