Re: [PHP] simplexml - can it do what I need?

2010-02-08 Thread TerryA
Got it! I corrected my syntax and this code now works as far as I can tell: xpath('//lot') as $lot) { echo $lot->numero_lot, 'type ', $lot->type, $lot->identification, ''; echo 'Prix maxi: ', $lot->tarif_max, ' Prix mini: ', $lot->tarif_min, ''; foreach( $lot->elements->element as

Re: [PHP] simplexml - can it do what I need?

2010-02-08 Thread TerryA
Hi Guys Thanks for all your input. This forum is great! I can get the attributes OK but I can't code the checking routing correctly. This is what I have: Many thanks again for your input. I tried this but it only gives me the data for each element. I need to be able to access the attributes of t

Re: [PHP] simplexml - can it do what I need?

2010-02-08 Thread Ashley Sheridan
On Sun, 2010-02-07 at 23:24 -0800, TerryA wrote: > Hi Carlos > > I looked at the documentation for hours but don't see any solution. I'm > uploading a sample file here. The full file contains around 100 properties > but the uploaded file has just one. I need to extract data from this file to > wr

Re: [PHP] simplexml - can it do what I need?

2010-02-07 Thread TerryA
Hi Carlos I looked at the documentation for hours but don't see any solution. I'm uploading a sample file here. The full file contains around 100 properties but the uploaded file has just one. I need to extract data from this file to write to a MySQL database. I have no problem in doing this unti

Re: [PHP] simplexml - can it do what I need?

2010-02-07 Thread Carlos Medina
TerryA schrieb: Hi Shawn Thanks for answering my query. I have looked at the suggestions: $xml = simplexml_load_file('file.xml', 'SimpleXMLElement', LIBXML_NOCDATA); I am/was able to load the file OK and to access the data by iteration. However, I can't find a way to extract data by attributes.

Re: [PHP] simplexml - can it do what I need?

2010-02-07 Thread TerryA
Hi Shawn Thanks for answering my query. I have looked at the suggestions: $xml = simplexml_load_file('file.xml', 'SimpleXMLElement', LIBXML_NOCDATA); I am/was able to load the file OK and to access the data by iteration. However, I can't find a way to extract data by attributes. I need something

Re: [PHP] simplexml - can it do what I need?

2010-02-06 Thread Shawn McKenzie
TerryA wrote: > My first post and I'm just a few days into learning PHP so that I can extract > data from an XML feed for updating a MySQL driven website. Simplexml grabs > most of my data without a problem but I can't get at the data in elements > such as: > > > > > I have around a hundred of