My problem lies in how the data is related. If my xml was structured as such it would be easy:
Code:
<MarriageLicence>
<Applicant>
...
</Applicant>
<JointApplicant>
...
</JointApplicant>
</MarriageLicence>
However it is not. So simplify the xml I have it is more like this:
Code:
<MarriageLicence>
<ApplicantId>11</ApplicantId>
<JointApplicantId>12</JointApplicantId>
<Applicant>
<id>11</id>
...
</Applicant>
<Applicant>
<id>12</id>
...
</Applicant>
</MarriageLicence>
The xml is actually generated from serizlizing database objects. I have two database objects MarriageLicence and Applicant. The MarriageLicence has two foreign keys to the Applicant for the Applicant and JointApplicant.
My solution to use the first Applicant as the Applicant and the Second as the JointApplicant works so long as the Applicant/JointApplicant always show up the the correct order.
I have also tried the following; however it didn't work either:
Code:
<xsl:apply-templatesselect="dcs:MarriageLicence[@i:type='Applicant']">
<xsl:with-paramname="ApplicantId">
<xsl:value-ofselect="ApplicantId"/>
</xsl:with-param>
</xsl:apply-templates>
...
<xsl:templatename="Applicant"match="dcs:MarriageLicence[@i:type='Applicant']">
<xsl:paramname="ApplicantId"></xsl:param>
<xsl:variablename="id">
<xsl:value-ofselect="dcs:id"/>
</xsl:variable>
<xsl:iftest="$id = ApplicantId">
...
</xsl:if>
</xsl:template>
Thanks,
Evan