Help with getting info from a poorly structured XML Tree using XSLT

Reply

Join Date: Mar 2008
Posts: 78
Reputation: rickya100 is an unknown quantity at this point 
Solved Threads: 1
rickya100 rickya100 is offline Offline
Junior Poster in Training

Help with getting info from a poorly structured XML Tree using XSLT

 
0
  #1
Nov 28th, 2008
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.

  1. <Child AccommodationCount="12" >
  2. <Resort ResortId="2472" ResortName="Andorra" CountryCode="AD" ></Resort>
  3. <Child>
  4. <Resort ResortId="3961" ResortName="Canillo" CountryCode="AD" ></Resort>
  5. <Child AccommodationCount="52" >
  6. <Resort ResortId="1720" ResortName="Soldeu" CountryCode="AD" ></Resort>
  7. </Child>
  8. <Child AccommodationCount="36" >
  9. <Resort ResortId="2476" ResortName="Pas de la Casa" CountryCode="AD" ></Resort>
  10. </Child>
  11. </Child>
  12. <Child AccommodationCount="1" >
  13. <Resort ResortId="3962" ResortName="La Massana" CountryCode="AD" ></Resort>
  14. <Child>
  15. <Resort ResortId="16120" ResortName="Pal-Arinsal" CountryCode="AD" ></Resort>
  16. <Child AccommodationCount="40" >
  17. <Resort ResortId="1722" ResortName="Arinsal" CountryCode="AD" ></Resort>
  18. </Child>
  19. </Child>
  20. </Child>
  21. </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
Last edited by rickya100; Nov 28th, 2008 at 10:14 am. Reason: Spelling mistake
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the XML, XSLT and XPATH Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC