Jump to content

Parsing XML with Simple XML


OriginalDavid

Recommended Posts

I'm trying to parse an XML file with Simple XML

 

Here's a part of the XML:

 

<CueList xmlns="urn:CueListSchema.xml" xmlns:s="urn:schemas-rcsworks-com:SongSchema" xmlns:n="urn:schemas-rcsworks-com:NoteSchema" xmlns:l="urn:schemas-rcsworks-com:LinkSchema" xmlns:t="urn:schemas-rcsworks-com:TrafficSchema" xmlns:p="urn:schemas-rcsworks-com:ProductSchema" xmlns:m="urn:schemas-rcsworks-com:MediaSchema" xmlns:w="urn:schemas-rcsworks-com:WebPageSchema" xmlns:ns="urn:CueListSchema.xml" time="2011-11-02T14:56:35">
<Event eventID="2" eventType="song" status="happening" scheduledTime="14:56:31" scheduledDuration="217.00">
<s:Song title="Mr.Brightside" internalID="0077000000025FA50000">
<s:Artist name="The Killers" sequenceNumber="1" internalID="0067000000020CB20000" sortName="The Killers"/>
<m:Media ID="{A9E1341C-A638-4048-B8B5-199667E69FA5}" runTime="217.03" fileName="{A9E1341C-A638-4048-B8B5-199667E69FA5}.wav"/>
</s:Song>
</Event>
</CueList>

 

Now, I've got it to read the first part <event>

 

foreach ($CueList->Event as $event) {

 

$type = $event['eventType'];

 

}

 

 

but I now want to read the Song Title on the next row down, and I'm having an issue with the s:Song part?

 

Any idea how I would do this, or even what you'd call that so I can look it up?

 

Thanks,

David

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.