Dear All
I have an xmldocument which is as formed below. It is a bit of loopy in
nature. can anyone kindly let me know how can i write a xslt which
would take a parameter which is an attribute value and would like to
have details out of the xml file.
I will the paste the xmldocument for your reference.The values required
as output are based on reverse pattern.The functionality requires this
pattern.The values required are as follows:
Required Output:Which happen to be as given below
cars/make = "alfa romeo"
cars/make/shortmodels/shortmod*el = "147"
cars/make/shortmodels/shortmod*el/longmodels/longmodel = "Distinctiv e"
cars/make/shortmodels/shortmod*el/longmodels/longmodel/deriva*tives/derviate[@vehicle_id='14 *825420040501']
= "1.6 T.Spark Distinctive hatchback"
The above values which are in quotes must be returned after using an
xslt by giving the following attribute @vehicle_id='14 825420040501
This particular xml file contains only 1 make, but in the original file
this make would be repeated in nature.
Example of the XML File.
<cars>
<make forsale="1">Alf a Romeo<shortmode ls>
<shortmodel>147 <longmodels>
<longmodel>Dist inctive<derivat *ives>
<derivative
vehicle_id="148 25420040501">
<price>13936</price>
<co2>192</co2>
<fueltype>U</fueltype>1.6 T.Spark Distinctive
hatchback<colou rs/>
<trims/>
</derivative>
<derivative
vehicle_id="148 25520040501">
<price>14667</price>
<co2>194</co2>
<fueltype>U</fueltype>1.6 T.Spark Distinctive
hatchback<colou rs/>
<trims/>
</derivative>
</derivatives>
</longmodel>
<longmodel>Ediz ione
Exclusiva<deriv atives>
<derivative
vehicle_id="697 43420040501">
<price>14323</price>
<co2>192</co2>
<fueltype>U</fueltype>1.6 T.Spark Edizione Exclusiva
hatchback<colou rs/>
<trims/>
</derivative>
<derivative
vehicle_id="697 43620040501">
<price>15054</price>
<co2>194</co2>
<fueltype>U</fueltype>1.6 T.Spark Edizione Exclusiva
hatchback<colou rs/>
<trims/>
</derivative>
<derivative
vehicle_id="697 44120040501">
<price>14658</price>
<co2>192</co2>
<fueltype>U</fueltype>1.6 T.Spark Edizione Exclusiva
hatchback<colou rs/>
<trims/>
</derivative>
</derivatives>
</longmodel>
<longmodel>Ediz ione
Sportiva<deriva tives>
<derivative
vehicle_id="697 43320040501">
<price>12648</price>
<co2>192</co2>
<fueltype>U</fueltype>1.6 T.Spark Edizione Sportiva
hatchback<colou rs/>
<trims/>
</derivative>
<derivative
vehicle_id="697 43520040501">
<price>13348</price>
<co2>194</co2>
<fueltype>U</fueltype>1.6 T.Spark Edizione Sportiva
hatchback<colou rs/>
<trims/>
</derivative>
</derivatives>
</longmodel>
</longmodels>
</shortmodel>
<shortmodel>156 <longmodels>
<longmodel>Dist inctive<derivat *ives>
<derivative
vehicle_id="697 15520040501">
<price>17136</price>
<co2>195</co2>
<fueltype>U</fueltype>1.6 T.Spark 16V Distinctive
sedan<colours/>
<trims/>
</derivative>
<derivative
vehicle_id="697 15620040501">
<price>17703</price>
<co2>202</co2>
<fueltype>U</fueltype>1.8 T.Spark 16V Distinctive
sedan<colours/>
<trims/>
</derivative>
</derivatives>
</longmodel>
<longmodel>Ediz ione
Esclusiva<deriv atives>
<derivative
vehicle_id="795 24520040501">
<price>16750</price>
<co2>195</co2>
<fueltype>U</fueltype>1.6 T.Spark 16V Edizione Esclusiva
sedan<colours/>
<trims/>
</derivative>
<derivative
vehicle_id="795 10720040501">
<price>17316</price>
<co2>202</co2>
<fueltype>U</fueltype>1.8 T.Spark 16V Edizione Esclusiva
sedan<colours/>
<trims/>
</derivative>
</derivatives>
</longmodel>
</longmodels>
</shortmodel>
</shortmodels>
</make>
</cars>
Thanks in advance...
Regards
Sunil.