Jump to content

[SOLVED] Parsing XML With : In Tag Names


keithodulaigh.com

Recommended Posts

Hi Everyone,

I'm trying to parse the XML document that I've attached. The problem is the tags have : in their name, for example: <dc:title>bla bla bla</dc:title>

 

Simple XML won't load the file without errors (it complains about some of the URLs in the document.) I've also tried the XML parser that I downloaded from here: http://www.criticaldevelopment.net/xml/doc.php (The download link is tucked away in the top left corner.)

 

The above parser loads the document without error. To retrieve the value inside <dc:title>value</dc:title> would require me writing something like: $parser->document->...->dc:title[0]->tagData; which I can't do.

 

Is there anyone who can point me in the right direction.

 

Thanks in advance,

Keith

 

PS:

I know I could use string replace to remove the : from the file but that's not desirable. The formatting of the document can't really be changed. It's the format used by Fedora Commons' Open Source Digital Repository. (http://www.fedora-commons.org/)

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/153900-solved-parsing-xml-with-in-tag-names/
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.