I receive a flat file and a Oracle view binding, I need to map schema from these two in to a send flat file. Employee Id is the common field in both the flat file and the Oracle view. I need to check the employee ID on both the input schema also check if the PREFERREDLASTNAME field in the Oracle is not null then send the PREFERREDLASTNAME from the Oracle view otherwise send the Last_Name from the file schema.
Here I am using the XSLT Call template. But I am not sure how to check if the PREFREEDEDLASTNAME is not NULL then set Last_Name as PREFREEDEDLASTNAME otherwise set the Last_Name from the input flat file.
<xsl:template name="GetLastNameVW_EMP_JOB_DEPT">
<xsl:param name="ID" />
<xsl:element name="Last_Name">
<xsl:value-of select="//s0:VW_EMP_JOB_DEPTRECORDSELECT[s0:EMPLOYEE_ID = $ID]/s0:PREFERREDLASTNAME" />
</xsl:element>
</xsl:template>
With the above XSLT it looks only for the Employee_Number = EMPLOYEE_ID in both the schemas and sets the Last_Name as PREFERREDLASTNAME and leaves blank if they are not equal. How can I modify my XSLT to perform the condition
This is the solution: