Re: simplexml - can it do what I need?
| From: | Ashley Sheridan | Date: | Mon, 08 Feb 2010 08:12:06 +0000 |
| Subject: | Re: simplexml - can it do what I need? | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-301876@lists.php.net to get a copy of this message | ||
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
> write to a MySQL database. I have no problem in doing this until it comes to
> the <elements>-><element> tags. I only need 3 of these elements. I can
> extract the data by iteration but that does not help me to get the three
> specific <element> tags that I need because there are some tags that appear
> for some properties and not for others so the order is different. Here is
> the file:
> http://old.nabble.com/file/p27496211/annnonces.xml
> annnonces.xml
> Thanks
> Terry
>
>
>
> --
> View this message in context:
> http://old.nabble.com/simplexml---can-it-do-what-I-need--tp27481222p27496211.html
> Sent from the PHP - General mailing list archive at Nabble.com.
>
>
As you iterate the <elements> tags, check their attributes with
getAttribute().
Thanks,
Ash
http://www.ashleysheridan.co.uk