XSLT for multiple sources
I have a requirement where I have 2 sources and one target. 1st source contains employee records and other source contains employee and dependent records. They will be joined based on the SSN no. I need to generate target with employee and multiple dependents. Currently with below approach:
<xsl:for-each select="source1Var/ yourComplexElementForSource1">
<xsl:variable name="id" select="id"/>
<xsl:variable name="x" select="x"/>
<xsl:variable name="y" select="$source2Var/yourComplexElementForSource2[id= $id)]/y"/>
<targetVarElement>
<xsl:value-of select="$x * $y"/>
</targetVarElement>
</xsl:for-each>
, the target file has one Employee and 1 dependent. It is not generating for other dependents
Ex: Source 1 record:
ESSN, DOB, DTHIRE etc
Source 2 record:
ESSN, DOB, MEDSTATUS, ACTDTAT etc
DSSN, DOB, ESSN, NEWSTAT, BUILDSTAT etc
DSSN1, DOB1, ESSN, NEWSTAT1, BUILDSTAT1 etc
the target should contain:
Layout1: ESSN, DOB, MEDSTATUS, ACTDTAT etc
Layout2: DSSN, DOB, ESSN, NEWSTAT, BUILDSTAT etc
DSSN1, DOB1, ESSN, NEWSTAT1, BUILDSTAT1 etc
the target currently is with only DSSN and does not have DSSN1:
Layout1: ESSN, DOB, MEDSTATUS, ACTDTAT etc
Layout2: DSSN, DOB, ESSN, NEWSTAT, BUILDSTAT etc
|