Rank: Guest
Joined: 12/13/2005 Posts: 0
|
Source Xml : <LotDetails> <GCode>Ship</GCode> <ProductQuantity>2</ProductQuantity> </LotDetails <LotDetails> <GCode>Reject</GCode> <ProductQuantity>4</ProductQuantity> </LotDetails> <LotDetails> <GCode>Gross</GCode> <ProductQuantity>3</ProductQuantity> </LotDetails> <LotDetails> <GCode>Acceptable</GCode> <ProductQuantity>5</ProductQuantity> </LotDetails>
TargetXml Field : <LotQty>
Here the condition to check to map the target field is :
If LotDetails/GCode = "Acceptable" and the corresponding ProductQuantity (null and zero) <LotQty> --> 5 [taken from the corresponding ProductQuantity ]
else if LotDetails/GCode = "Ship" and the corresponding ProductQuantity not (null and zero) <LotQty> --> 2
else if LotDetails/GCode = "Gross" and the corresponding ProductQuantity not (null and zero) <LotQty> --> 3 else <LotQty> --> 0
Here the LotQty should happen only once based on any of the conditions Please let know xslt experts on the best way to do this ?
|
Rank: Advanced Member
Joined: 2/27/2009 Posts: 564
|
Certainly you'll want to use an xsl:choose structure. Have you already tried that? What went wrong?
|