IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

XSLT conditional mapping on loop Options · View
Anjana
Posted: Sunday, August 27, 2017 4:48:03 AM
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 ?


K101
Posted: Friday, September 1, 2017 9:24:41 AM
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?
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.