At 06:57 28/10/2007, you wrote:
From: "Andrew Darby" <[EMAIL PROTECTED]>

Hello, all.  I'm trying to use SimpleXML to loop through an .xml file,
but when I try to do the following, it chokes on the colon:

foreach ($xml_data->dc:title as $item) {

[do whatever here]


The element in the XML has a colon in it, i.e.,

<dc:title>Interesting Book</dc:title>

Anybody know how to deal with this? I must be missing something obvious

Yes, but only slightly. The Zend site has a good article on setting SimpleXML to handle the namespaced nodes :

NB this is really a database mailing list from the point of view of PHP, you might need to consider an XML list in future ;-)

Cheers - Neil

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to