Hi Oskar
- Code: Select all
foreach($item->child_nodes() as $itemChild)
echo $itemChild->get_content();
}
$item is the membermessage so when you do $item->child_nodes you'll get the lot. I don't know the datastructure of <MemberMessage> and what element(s) you want. You need a method which selects by tag name. In fact in your code you have just this only it isn't doing anything there:
- Code: Select all
$message = $item->get_elements_by_tagname('MemberMessageExchange');
you could try replacing the block I copied at the top of this post with this where 'Email' is the name of the element you want:
- Code: Select all
foreach($item->get_elements_by_tagname('Email') as $itemChild)
echo $itemChild[0]->get_content();
}
I'm not sure if this will work. get_elements_by_tagname returns a list of matching nodes. I would expect this to be just one hence the [0] on the echo line.
I'm happy to help you more but I would need to see if poss the
XML for MemberMessage and to know which field(s) you want
It looks like the
PHP XMLDOM does not support XPATH which would have solved the problem very easily.
Justin