Wrox Programmer Forums
|
BOOK: Beginning XSLT and XPath : Transforming XML Documents and Data
This is the forum to discuss the Wrox book Beginning XSLT and XPath : Transforming XML Documents and Data by Ian Williams ISBN: 978-0-470-47725-0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning XSLT and XPath : Transforming XML Documents and Data section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 11th, 2013, 12:45 AM
Registered User
 
Join Date: Nov 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Datasets from multiple Data Sources SQL_Hacker Reporting Services 1 June 18th, 2008 02:25 PM
Deal with multiple sources Hind XSLT 2 June 5th, 2006 07:16 AM
Populating DropDownList from multiple sources hawkfb63 ASP.NET 2.0 Professional 2 February 14th, 2006 06:42 PM
Query from multiple data sources billmedd BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 September 27th, 2004 10:46 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.