tags:

views:

54

answers:

1

hi friends, I have some questions , because i am not good in XSLT...

For example, I have 3 types of xml from three companies

XML 1 (Company 1) file1.xml

<HotelList name="Company1">
   <Hotel><HotelCode>C1004</HotelCode>

                 <HotelName>Hotel 4</HotelName>

                <Price>100</Price>

   </Hotel>
    <Hotel><HotelCode>C1001</HotelCode>

                <HotelName>Hotel 1</HotelName>

                <Price>20</Price>

   </Hotel>
   <Hotel><HotelCode>C1003</HotelCode>

                <HotelName>Hotel 3</HotelName>

                <Price>15</Price>

   </Hotel>
   <Hotel><HotelCode>C1002</HotelCode></HotelList>

               <HotelName>Hotel 2</HotelName>

                <Price>10</Price>

   </Hotel>

XML 2 (Company 2) file2.xml

<HotelList name="Company2">
    <Hotel><HotelCode>C2002</HotelCode>

               <HotelName>Hotel Two</HotelName>

                <PriceList><Price>15</Price></PriceList>

   </Hotel>
   <Hotel><HotelCode>C2005</HotelCode>

                 <HotelName>Hotel Five</HotelName>

                 <PriceList><Price>100</Price></PriceList>

   </Hotel>
   <Hotel><HotelCode>C2003</HotelCode>

                <HotelName>Hotel Three</HotelName>

                <PriceList><Price>7</Price></PriceList>

   </Hotel>
   <Hotel><HotelCode>C2004</HotelCode>

                 <HotelName>Hotel Four</HotelName>

                <PriceList><Price>99</Price></PriceList>

   </Hotel>


   <Hotel><HotelCode>C2001</HotelCode>
</HotelList>

                <HotelName>Hotel One</HotelName>

                <PriceList><Price>10</Price></PriceList>



 </Hotel>

XML 3 (Company 3) file3.xml

<HotelList name="Company2">
    <Hotel><HotelCode>13 </HotelCode>

                <HotelName>Hotel One</HotelName>

                <Rates><PriceList><Price>11</Price></PriceList></Rates>

   </Hotel>
   <Hotel><HotelCode>23</HotelCode>

               <HotelName>Hotel Two</HotelName>

               <Rates><PriceList><Price>8</Price></PriceList></Rates>

   </Hotel>
     <Hotel><HotelCode>53</HotelCode>

                 <HotelName>Hotel Five</HotelName>

                <Rates><PriceList><Price>100</Price></PriceList></Rates>

   </Hotel>

  <Hotel><HotelCode>63</HotelCode>

                 <HotelName>Hotel Six</HotelName>

                <Rates><PriceList><Price>120</Price></PriceList></Rates>

   </Hotel>
  <Hotel><HotelCode>33</HotelCode>

                <HotelName>Hotel Three</HotelName>

               <Rates><PriceList><Price>7</Price></PriceList></Rates>

   </Hotel>
   <Hotel><HotelCode>43</HotelCode>

                 <HotelName>Hotel Four</HotelName>

               <Rates><PriceList><Price>85</Price></PriceList></Rates>

   </Hotel>


</HotelList>

1) Here the xml, Hotel's ids are not in order way

2) Hotel id and hotel names is not a constant one

3) If hotel id is not constant, there is any need for create a sql table for keeping constant id? Some thing like this

HotelName             HotelCode          NewHotelName          NewHotelCode

Hotel 1                    C1001               Hotel-1                           1

Hotel 2                    C1002               Hotel-2                           2

Hotel 3                    C1003               Hotel-3                           3

Hotel 4                    C1004               Hotel-4                           4

Hotel One                C2001               Hotel-1                           1

Hotel Two                C2002               Hotel-2                           2

Hotel Three              C2003               Hotel-3                           3

Hotel Four                C2004               Hotel-4                           4

Hotel Five                 C2005               Hotel-5                           5

Hotel One                 13                    Hotel-1                           1

Hotel Two                 23                    Hotel-2                           2

Hotel Three               33                    Hotel-3                           3

Hotel Four                 43                    Hotel-4                           4

Hotel Five                  53                    Hotel-5                           5

Hotel Six                    63                    Hotel-6                          6

3) My aim is that, to display less price hotels (with out duplicate) from these three xml’s

4) I need the result is

Hotel Name: Hotel-1

Hotel Code: C2001

Hotel New Code: 1

Price :10



Hotel Name: Hotel-2

Hotel Code: 23

Hotel New Code: 2

Price :8



Hotel Name: Hotel-3

Hotel Code: C1003

Hotel New Code: 3

Price :7



Hotel Name: Hotel-4

Hotel Code: 43

Hotel New Code: 4

Price :85



Hotel Name: Hotel-5

Hotel Code: C2005

Hotel New Code: 5

Price :100



Hotel Name: Hotel-6

Hotel Code: 63

Hotel New Code: 6

Price :120
A: 

Yes, see this reference for an example.

Eric J.