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.

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

The control with ID 'ace' requires a ScriptManager on the page
I'm trying to add a simple AlwaysVisibleControlExtender to my page, but it's not working. I get the

ereg_replace()
Basically what i need to do is

$title = "This Suck's"

$striped = ereg_repl

Warning: mysql_num_rows() expects parameter 1
When i add quote at the end of this link
example:http://localhost/articlemania/category.php?cid=3

Preg_match question
I want to use preg_match to make sure a string is always 6 characters long and only contains 0-9 and

Certain files upload, while others do not
I want to read the data from an uploaded file. Not sure why, but it only uploads for certain files.

BB_Code error
I'm having a problem with a custom built function and keep getting this error:


Warning: M

Problem executing bash script using shell_exec
Hi there,
I created a bash script file using following code to convert doc documents to pdf using

php ajax - two drop down list with a submit button
i have created a form with 2 drop-down list and a submit button. I would like to know how to pass th

Why do I get this error?
Error:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or

BSP Ext - tableView - Sort - NEWBIE
Hi,
I have been trying to get the sort to work. I have defined the column definitions by fillin

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