I've been playing around with this again and still no joy. I have changed my code to the following:
Code: Select all
<?php
$file = $_FILES['userfile']['tmp_name'];
$xml_str = file_get_contents ($file);
echo 'xml_str: <br><br>'.$xml_str;
//==============================================
//ITEMS
//==============================================
//create items list
$orgs_str = get_unique_element($xml_str,'organizations');
$items = get_node_strings($orgs_str,'item');
$items = process_items($items);
echo '<br>'.$items[0]['identifierref'];
?>
If i have line 15 in my code like this:
Code: Select all
$orgs_str = get_unique_element($xml_str,'organizations');
I get data from my xml file, as expected. However, if I access a node that has a colon in it like this:
Code: Select all
$orgs_str = get_unique_element($xml_str,'organizations:test');
I get the following error;
Notice: Undefined offset: 0 in ...ims_menu.php on line 15
line 15 being where I am using the colon. Is there any way I can wrap that character so that it won't be treated as a break of some sort, and the string treated as a whole?
Thanks