note 97396 added to class.simplexmlelement

From: Date: Sat, 17 Apr 2010 17:31:13 +0000
Subject: note 97396 added to class.simplexmlelement
Groups: php.notes 
Request: Send a blank email to php-notes+get-168353@lists.php.net to get a copy of this message
In order to make an itunes-store-compliant podcast, you need: <?xml version="1.0" encoding="UTF-8"?> <rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"> then the rest of the xml output. But as $xml_result = $xml_generator->asXML(); won't let you do that, here's the workaround: [PHP]$xml_result = $xml_generator->asXML(); $xml_LeftHandSide = '<?xml version="1.0" encoding="UTF-8"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">'; $xml_RightHandSide = substr($xml_result, 22); echo $xml_LeftHandSide . $xml_RightHandSide . "</rss>";[/PHP] et voila! feedvalidator and itunes are happy. ---- Server IP: 78.110.173.36 Probable Submitter: 87.113.18.6 ---- Manual Page -- http://www.php.net/manual/en/class.simplexmlelement.php Edit -- https://master.php.net/note/edit/97396 Del: integrated -- https://master.php.net/note/delete/97396/integrated Del: useless -- https://master.php.net/note/delete/97396/useless Del: bad code -- https://master.php.net/note/delete/97396/bad+code Del: spam -- https://master.php.net/note/delete/97396/spam Del: non-english -- https://master.php.net/note/delete/97396/non-english Del: in docs -- https://master.php.net/note/delete/97396/in+docs Del: other reasons-- https://master.php.net/note/delete/97396 Reject -- https://master.php.net/note/reject/97396 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#168353) next »