Updating Xml with PHP doesn't give expected result

gamusinous

New Member
I really don't understand what is wrong. ` When I run the code I get error that reads "Catchable fatal error: Argument 1 passed to DOMNode::appendChild() must be an instance of DOMNode, null given in /home/a2489440/public_html/playlistaction.php on line 39" I don't quite know what that means can someone please help me? Thanks in advance and here is the url where I am attempting to use this code.Here is my code \[code\]$doc = new DOMDocument(); $doc->load( 'playlist.xml' ); $doc->formatOutput = true; $r = $doc->getElementsByTagName("musiclist")->item(0); $b = $doc->createElement("track"); $path = $doc->createElement("path"); $path->appendChild( $doc->createTextNode( $track["path"] ) ); $b->appendChild( $path ); $title = $doc->createElement("title"); $title->appendChild( $doc->createTextNode( $track["title"] ) );\[/code\]
 
Back
Top