Hi,
I'm not able to fetch value from the following XML files:
Can anyone tell me to fetch - lets "Deposit Policy" information from this xml files - using XQuery - or let me know if any better method is available
<?xml version="1.0" ?>
<HotelML xmlns="www.test.com">
<Head>
<Route Destination="01" Source="00">
<Operation Action="Create" App="TIDispatcher" AppVer="1.12.40.2.8.1" DataPath="/HotelML" StartTime="2008-11-08T14:26:28.694+00:00" Success="true" TotalProcessTime="251" />
</Route>
</Head>
<Property xml:lang="en" Code="BW;05250" Name="Best Western Gateway Inn" Token="1226154388618">
<Amenity xml:lang="en" Code="BAR" Description="Bar/Lounge" />
<Amenity xml:lang="en" Code="REST" Description="Restaurant" />
<Amenity xml:lang="en" Code="POOL" Description="Pool" Property="true" />
<Amenity xml:lang="en" Code="ROOM" Description="Room Service" Property="true" />
<AreaAttraction Name="Restaurants:" />
<AreaAttraction Name="Nearby Cities:" />
<AreaAttraction Description="* In the heart of Silicon Valley * 2 miles from the Great America Theme Park * 5 miles from the Winchester Mystery House * 6 miles from Santa Clara/San Jose Convention Center * 30 miles from Oakland Coliseum * 40 miles from Monterey Peninsula * 80 miles from Napa Wine Country" Name="Local attractions, events and activities include">
<Media Link="05250_m.gif" MIME="image/gif" Type="Map" />
</AreaAttraction>
<AreaAttraction Description="* 40 miles from San Francisco" Name="Nearby Cities" />
<AreaAttraction Name="Local Attractions:" />
<AreaAttraction Name="Transportation:" />
<AreaAttraction Name="Area Map">
<Media Link="05250_m.gif" MIME="image/gif" Type="Map" />
</AreaAttraction>
<AreaAttraction Name="Area Map">
<Media Link="05250_m.gif" MIME="image/gif" Type="Map" />
</AreaAttraction>
<Brand Code="BW">
<Email Address="nguyenn@bestwestern.com" />
</Brand>
<CancelPolicy Description="Cancellation policies vary from hotel to hotel. Most current and accurate cancellation policies will appear on your confirmed reservation notification." />
<DepositPolicy AcceptedCreditCard="AX, CB, DC, DS, CA, VI, AM, JC" />
<GeneralInfo AirportText="San Jose International Airport" AreasServed="San Jose, Santa Clara, Sunnyvale, Palo Alto, Milpitas, California" CheckInTime="3:00 P.M." CheckOutTime="12:00 Noon" HotelRating="AAA Rating: 3 Diamonds; MOBIL Rating: 2 Stars" LocationDescription="From Highway 101, take the Trimble Road Exit, and then take the first right on Seaboard Avenue and follow the signs to the Best Western Gateway Inn." NativeCurrency="USD" NumberOfFloors="2" NumberOfRooms="146" OpenEffectiveDate="1996-12-15" PropertyDescription="Gracious hospitality sets the pace at the Best Western Gateway Inn. Whether you are traveling for business or pleasure, our close attention to detail will make your stay in San Jose a memorable one. At the Best Western Gateway Inn you will find comfort and pleasure that are reminiscent of times past. Upon entering our lobby, you will be greeted by an enthusiatic helpful staff - 24 hours a day." RateDisclaimer="Indicative rates are for search purposes only. The entire range of rates may not be available during certain seasons or other specified periods of time. Check for specific rate availability when making a reservation." YearRenovatedText="1992" />
<GeoInfo Accuracy="Property" Latitude="37.378991" Longitude="-121.938126" TimeZone="Pacific Standard Time" />
<GuaranteePolicy Description="You must use a credit card to book online." />
<Media Link="05250_b1a.jpg" MIME="image/jpeg" Type="Picture" />
<Media Link="05250_b8a.jpg" MIME="image/jpeg" Type="Picture" />
<Media Link="05250_b9a.jpg" MIME="image/jpeg" Type="Picture" />
<Phone Number="(408)435-8800" />
<Phone Number="1-800-437-8855" Type="Reservation" />
<Phone Number="408-435-8879" Type="FAX" />
<PostalAddress City="San Jose" CountryCode="US" Line1="2585 Seaboard Avenue" PostalCode="95131" StateCode="CA" />
<RoomInfo Name="1 QUEEN BED,NO SMKNG,COFFEE MAKER,REFRIGERATOR,CON" Type="Standard Room" />
<RoomInfo Name="1 KING BED,NO SMKNG,COFFEE MAKER,REFRIGERATOR,CONT" Type="Standard Room" />
<RoomInfo Name="2 QUEEN BEDS,NO SMKNG,COFFEE MAKER,REFRIGERATOR,CO" Type="Standard Room" />
</Property>
</HotelML>
Regards
by: GertonePosted on 2008-11-08 at 07:57:56ID: 22912850
If all you need is the deposit policy,
you can do that in a single XPath "//xxx:DepositPolicy" if you first bind xxx to "www.test.com", so you also need a namespace manager
whatever language you are using to deal with this, should allow you to do that
How would you perform the XQuery? Is this in a database?
Tell me first how you were going to tackle all around the XQuery (programming language, tool or applications)
then I can give you the best fit.
XQuery seems somewhat ocverkill for this problem