I have the following xml:
<?xml version="1.0" encoding="UTF-8"?>
<abc1 formName="Form">
<Level1>
<Element1>ZZZ</Element1>
<Element2>
<SubElement1>Apples</SubElement1>
<SubElement2>Oranges</SubElement2>
<SubElement3>Pears</SubElement3>
<SubElement4>Blueberries</SubElement4>
<SubElement5>Milkshakes</SubElement5>
</Element2>
</Level1>
<Level1>
<Element1>XXX</Element1>
<Element2>
<SubElement1>Apples</SubElement1>
<SubElement2>Oranges</SubElement2>
<SubElement3>Kiwifruit</SubElement3>
<SubElement4>Blueberries</SubElement4>
<SubElement5>Soda</SubElement5>
</Element2>
</Level1>
</abc1>
and what I need to be able to do is take a look at the values in some nodes, determine if they are different, and if so write some different html code with a page break between each section.
So, I need to compare the <Element1> values and see if they are different. The <Element1> values could be any text, and the number of <Element1>tags could be unlimited in the xml.
So in this case, we have two different <Element1> values: 'ZZZ' and 'XXX'.
So something like the following if there are two '':
<xsl:choose>
<xsl:when test="differentvalues = 'true'">
<!-- SomeHTMLCode!-->
<p style="page-break-after: always"/>
<!-- SomeHTMLCode!-->
</xsl:when>
<xsl:otherwise><!-- SomeHTMLCode!--></xsl:otherwise>
</xsl:choose>
but using the for-loop to search through the xml, and something like
<xsl:choose>
<xsl:when test="differentvalues = 'true'">
<!-- SomeHTMLCode!-->
<p style="page-break-after: always"/>
<!-- SomeHTMLCode!-->
<p style="page-break-after: always"/>
<!-- SomeHTMLCode!-->
</xsl:when>
<xsl:otherwise><!-- SomeHTMLCode!--></xsl:otherwise>
</xsl:choose>
if there are three different </Element1> values.
I'm not even sure if this can be done. Thanks in advance for any help you can provide me with.