Jump to content
Sign in to follow this  
balaji44

Loop Through in XSL

Recommended Posts

Hi, I am new to XSL. I don't know how to loop through XML and filter duplicates using XSL. Here is my requirement.My XML---------<?xml version="1.0" ?><X12Summary> <Unit volume="10" Amount="100"> <Identifier Name="Customer ID" Value="12345" /> <Identifier Name="Customer Name" Value="Jones Thomas" /> <?xml version="1.0" ?><X12Summary> <Unit volume="10" Amount="100"> <Identifier Name="Customer ID" Value="12345" /> <Identifier Name="Customer Name" Value="Jones Thomas" /> <Identifier Name="Address" Value="addr1" /> <Identifier Name="City" Value="Atlanta" /> <Identifier Name="Zipcode" Value="10231" /> <Identifier Name="Brand" Value="new" /> <Identifier Name="TimeZone" Value="EST" /> </Unit> <Unit volume="10" Amount="1000"> <Identifier Name="Customer ID" Value="12345" /> <Identifier Name="Customer Name" Value="Jones Thomas" /> <Identifier Name="Address" Value="addr2" /> <Identifier Name="City" Value="Chicago" /> <Identifier Name="Zipcode" Value="10232" /> <Identifier Name="Brand" Value="old" /> <Identifier Name="TimeZone" Value="EST" /> </Unit> <Unit volume="10" Amount="1500"> <Identifier Name="Customer ID" Value="12345" /> <Identifier Name="Customer Name" Value="Jones Thomas" /> <Identifier Name="Address" Value="addr3" /> <Identifier Name="City" Value="Dallas" /> <Identifier Name="Zipcode" Value="16232" /> <Identifier Name="Brand" Value="new" /> <Identifier Name="TimeZone" Value="CST" /> </Unit> <Unit volume="10" Amount="1500"> <Identifier Name="Customer ID" Value="23451" /> <Identifier Name="Customer Name" Value="David Beckley" /> <Identifier Name="Address" Value="addr4" /> <Identifier Name="City" Value="mexico" /> <Identifier Name="Zipcode" Value="15732" /> <Identifier Name="Brand" Value="new" /> <Identifier Name="TimeZone" Value="CST" /> </Unit> <Unit volume="10" Amount="1520"> <Identifier Name="Customer ID" Value="23451" /> <Identifier Name="Customer Name" Value="David Beckley" /> <Identifier Name="Address" Value="addr5" /> <Identifier Name="City" Value="UAE" /> <Identifier Name="Zipcode" Value="1245125" /> <Identifier Name="Brand" Value="new" /> <Identifier Name="TimeZone" Value="PST" /> </Unit></X12Summary> <Identifier Name="Address" Value="addr1" /> <Identifier Name="City" Value="Atlanta" /> <Identifier Name="Zipcode" Value="10231" /> <Identifier Name="Brand" Value="new" /> <Identifier Name="TimeZone" Value="EST" /> </Unit> <Unit volume="10" Amount="1000"> <Identifier Name="Customer ID" Value="12345" /> <Identifier Name="Customer Name" Value="Jones Thomas" /> <Identifier Name="Address" Value="addr2" /> <Identifier Name="City" Value="Chicago" /> <Identifier Name="Zipcode" Value="10232" /> <Identifier Name="Brand" Value="old" /> <Identifier Name="TimeZone" Value="EST" /> </Unit> <Unit volume="10" Amount="1500"> <Identifier Name="Customer ID" Value="12345" /> <Identifier Name="Customer Name" Value="Jones Thomas" /> <Identifier Name="Address" Value="addr3" /> <Identifier Name="City" Value="Dallas" /> <Identifier Name="Zipcode" Value="16232" /> <Identifier Name="Brand" Value="new" /> <Identifier Name="TimeZone" Value="CST" /> </Unit> <Unit volume="10" Amount="1500"> <Identifier Name="Customer ID" Value="23451" /> <Identifier Name="Customer Name" Value="David Beckley" /> <Identifier Name="Address" Value="addr4" /> <Identifier Name="City" Value="mexico" /> <Identifier Name="Zipcode" Value="15732" /> <Identifier Name="Brand" Value="new" /> <Identifier Name="TimeZone" Value="CST" /> </Unit> <Unit volume="10" Amount="1520"> <Identifier Name="Customer ID" Value="23451" /> <Identifier Name="Customer Name" Value="David Beckley" /> <Identifier Name="Address" Value="addr5" /> <Identifier Name="City" Value="UAE" /> <Identifier Name="Zipcode" Value="1245125" /> <Identifier Name="Brand" Value="new" /> <Identifier Name="TimeZone" Value="PST" /> </Unit></X12Summary>Output should be in HTML table------------------------------------12345 - Jones ThomasAddress City Zipcode Brand TimeZone Amountaddr1 Atlanta 10231 new EST 100addr2 Chicago 10232 old EST 1000addr3 Dallas 16232 new CST 150023451 - David BeckleyAddress City Zipcode Brand TimeZone Amountaddr4 mexico 15732 new CST 1500addr5 UAE 1245125 old PST 1520Can anyone pls help me to get XSL for this. Thanks in advance

Edited by Balaji N

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...