Jump to content

Accessing xml with colon in tag name


lr

Recommended Posts

Hi guys,

 

I have xml that looks like:

 

<item>

<title></title>

<link></link>

<description></description>

<dc:date>2011-02-27T16:42:31-05:00</dc:date>

</item>

 

 

I can access title, link, and description just fine.  But how do I access a tag that has a colon?

 

I tried this:

 

$x = new SimpleXmlElement($content);
$entry = $x->item;

$entry->children('dc', true)->date;

 

Thanks for looking.

 

LR

 

Link to comment
https://forums.phpfreaks.com/topic/229757-accessing-xml-with-colon-in-tag-name/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.