DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   XML, XSLT and XPATH (http://www.daniweb.com/forums/forum134.html)
-   -   Help with getting info from a poorly structured XML Tree using XSLT (http://www.daniweb.com/forums/thread159854.html)

rickya100 Nov 28th, 2008 10:01 am
Help with getting info from a poorly structured XML Tree using XSLT
 
Hi,

I have been trying to get resorts from an XML tree but I have found that it seems to be very flat and not helpful at all in terms of targeting information.

Attribute names are all the same whether it is the world element, region of world element, country element, region of country element or a resort in a region element.

Here is a section of it. I need to find out the Resorts per country region.

<Child AccommodationCount="12" >
<Resort ResortId="2472"  ResortName="Andorra"  CountryCode="AD" ></Resort>
<Child>
<Resort ResortId="3961"  ResortName="Canillo"  CountryCode="AD" ></Resort>
<Child AccommodationCount="52" >
<Resort ResortId="1720"  ResortName="Soldeu"  CountryCode="AD" ></Resort>
</Child>
<Child AccommodationCount="36" >
<Resort ResortId="2476"  ResortName="Pas de la Casa"  CountryCode="AD" ></Resort>
</Child>
</Child>
<Child AccommodationCount="1" >
<Resort ResortId="3962"  ResortName="La Massana"  CountryCode="AD" ></Resort>
<Child>
<Resort ResortId="16120"  ResortName="Pal-Arinsal"  CountryCode="AD" ></Resort>
<Child AccommodationCount="40" >
<Resort ResortId="1722"  ResortName="Arinsal"  CountryCode="AD" ></Resort>
</Child>
</Child>
</Child>
</Child>

Can anyone help me with the XPath required to target this. I have worked on this for days and cannot pull it off.

If anyone knows the fix please post it up or even a quick tip in the right direction.

Many thanks


All times are GMT -4. The time now is 8:20 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC