| Welcome to Webforumz.com. |
|
Apr 8th, 2008, 10:01
|
#1 (permalink)
|
|
Reputable Member
Join Date: Dec 2005
Location: scotland
Age: 26
Posts: 135
|
xpath problem
i have a xml doc like this
- Code: Select all
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<root>
<property>
<id>535054</id>
<date>2008-03-02 21:33:19</date>
<ref>ln233-3</ref>
<price>228000</price>
<price_freq>sale</price_freq>
<type>
<en>Villa</en>
<es>Chalet</es>
<de>Villa</de>
<fr>Villa</fr>
</type>
<town>Alcazares, Los</town>
<province>Murcia</province>
<location_detail>30710 Tercia, La</location_detail>
<beds>3</beds>
<baths>2</baths>
<pool>1</pool>
<desc>
<en>Excellent value for money and investment opportunity. very favourable payment terms; only 10% initial staged payment.
Villa mirian is a 3 bed of 76,20m2 build la tercia real is ideally located at the foot of the "sierra de columbares" natural park, 15 mins from the shores of the mar menor and san javier airport and also close to murcia city and the new murcia international airport at corbera, due to open 2008/2009. there a number of golf resorts in the surrounding area, including 1 walking distance. la tercia real is situated in a beautiful, peaceful rural setting and yet so close to all the amenities, and is ideal for permanent or winter residence. within the resort are vast green areas, wide avenues and tree-lined streets, and communal gardens and swimming pools. the original hacienda, a listed building, will remain in the heart of the community and be refurbished to provide a focal point for social activities and "the village", spanish pueblo will house restaurants, bars and shops and amenities.
Also available on a 308m2 plot at 242,500 larger plots available price on application
Also available as a 2bed property from 193,000
availability: for sale
type: new
style: villa
bed: 3
bath: 2
pool: communal pool, private pool option
garden: private plot & garden
parking: parking off-road
size: plot min 250m2
build: 76,20m2</en>
<es></es>
<de></de>
<fr></fr>
</desc>
<images>
<image id="1">
<url>http://images.com/images/property/535/535054/1_large.jpg</url>
<title>
<en>Image 1</en>
</title>
</image>
<image id="2">
<url>http://images.com/images/property/535/535054/2_large.jpg</url>
<title>
<en>Image 2</en>
</title>
</image>
</images>
</property>
<property>
<id>535055</id>
<date>2008-02-17 00:53:32</date>
<ref>ln233</ref>
<price>193000</price>
<price_freq>sale</price_freq>
<type>
<en>Villa</en>
<es>Chalet</es>
<de>Villa</de>
<fr>Villa</fr>
</type>
<town>Alcazares, Los</town>
<province>Murcia</province>
<location_detail>30710 Tercia, La</location_detail>
<beds>2</beds>
<baths>2</baths>
<pool>1</pool>
<desc>
<en>Excellent value for money and investment opportunity. very favourable payment terms; only 10% initial staged payment.
Villa Mirian is 2 bed, 2 bath on min plot 250m2 & build 62,11m2.
La Tercia Real is ideally located at the foot of the "sierra de columbares" natural park, 15 mins from the shores of the mar menor and San Javier airport and also close to Murcia city and the new Murcia international airport at Corvera, due to open 2008/2009. there a number of golf resorts in the surrounding area, including 1 walking distance. la tercia real is situated in a beautiful, peaceful rural setting and yet so close to all the amenities, and is ideal for permanent or winter residence. within the resort are vast green areas, wide avenues and tree-lined streets, and communal gardens and swimming pools. the original hacienda, a listed building, will remain in the heart of the community and be refurbished to provide a focal point for social activities and "the village", spanish pueblo will house restaurants, bars and shops and amenities.
Also available on a plot of 300m2 priced at 211,000 also available on larger plots price on application
Or a 3 bed Mirrian from 228,000
availability: for sale
type: new
style: villa
bed: 2
bath: 2
pool: communal pool, private pool option
garden: private plot & garden
parking: parking off-road
size: plot min 250m2
build:62,11m2 </en>
<es></es>
<de></de>
<fr></fr>
</desc>
<images>
<image id="1">
<url>http://images.com/images/property/535/535055/4_large.jpg</url>
<title>
<en>Image 4</en>
</title>
</image>
<image id="2">
<url>http://images.com/images/property/535/535055/5_large.jpg</url>
<title>
<en>Entrance and shopping avenue</en>
</title>
</image>
<image id="3">
<url>http://images.com/images/property/535/535055/6_large.jpg</url>
<primary>1</primary>
<title>
<en>Showhouse of Mirrian</en>
</title>
</image>
.........
I'm looking to only show the properties in Alicante, so i have this
- PHP: Select all
foreach ($xml->xpath('//property[province="Alicante"]') as $alicante) {
//do something....
}
this is not working, can someone tell me why? it only loops the 1st property?
Also I would like to split the results onto different pages. What is the best way to do this?
ta
__________________
Last edited by karloff; Apr 8th, 2008 at 12:43.
|
|
|
| Thread Tools |
|
|
| Rate This Thread |
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|