n2learning Posted April 4, 2012 Share Posted April 4, 2012 I am using SimpleXMLElement to generate an xml file. I am having some difficulty with formating the file. Hoping someone can assist. (not having problem getting the data...just unsure when to use ->addChild, ->addAttribute and anything else) This is the structure of how the file needs to be appear: <?xml version="1.0"?> <rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:jwplayer="http://developer.longtailvideo.com/trac/" > <channel> <title>MRSS Playlist</title> <item> <title>Cardio routine with handweights</title> <media:content url="videos/set2_first_5min.flv" /> <media:thumbnail url="thumbs/set2_first.png" /> <description>side jumps, arm curls, leg squats, arm lifts</description> <jwplayer:duration>25</jwplayer:duration> <jwplayer:start>5</jwplayer:start> </item> </channel> </rss> Thanks as always! DK Quote Link to comment https://forums.phpfreaks.com/topic/260362-output-xml-file/ Share on other sites More sharing options...
requinix Posted April 4, 2012 Share Posted April 4, 2012 Nothing says you have to use SimpleXML. You can build it normally like it was HTML (if that's what you're doing with it): '; ?> MRSS Playlist title); ?> description); ?> duration; ?> start; ?> Quote Link to comment https://forums.phpfreaks.com/topic/260362-output-xml-file/#findComment-1334479 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.