DOMDocument parsing


Posted on 16th Feb 2014 07:03 pm by admin

Hello, I am parsing an xml file from an API which I have converted into a DOMDocument in php. This is mostly fine but one problem I have is when I do this:
Code: [Select]$feeditem->getElementsByTagName('extra');
as part of a forall statment and the element extra doesn't exist in one of the feeditems I am iterating through in the forall condition then I get an error.

Did you know?Explore Trending and Topic pages for more stories like this.
I think I need some kind of statment like:

Code: [Select]if ($feeditem->getElementsByTagName('extra') ISN'T NULL)
But don't know how to formulate it. Please help. Thanks.
No comments posted yet

Your Answer:

Login to answer
133 Like 5 Dislike
Previous forums Next forums
Other forums

Is there something wrong?
Hi all,

Just a quick question... can someone look at this code and see if something is wrong?

PHP Cannot redeclare class
I have 6 files, and two of them do not seem to want to play well. I keep getting a "Cannot rede

Running a cron job through PHP/Apache?!
Hello all,
I have a PHP script which makes a cron file from user input. When i try to run the cro

I am stumped
OK. Here is what I am trying to do. I have the conditions set, and if the conditions are met, I want

Having a problem get the selected item from a drop down menu
I have been looking at this for days now.

I have a drop down menu that get it's values from a

Mouseover to edit (Ajax)
hi friends, can anyone help with the code behind to get this application working, please in VB (new

Revoking alter any table from a schema
Hi All,

i am working in Oracle 10g.
my requirement is to revoke all kind of DDL oper

PHP, jAVASCRIPT setting input values, why isn't it working?
Hi:

I am calling this javascript:
<script language="javascript">

Save User Inputs while javascript reloading!
hi..
i have written a PHP code in which i reload the page when user selects a value in dropdown..

How to copy a part of a vector in a raw memory
Hi,

How can I copy a part of a vector into a memory:

1
2
3
4
5

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash