note 55009 added to ref.simplexml

From: Date: Fri, 22 Jul 2005 10:43:36 +0000
Subject: note 55009 added to ref.simplexml
Groups: php.notes 
Request: Send a blank email to php-notes+get-92286@lists.php.net to get a copy of this message
From my testing SimpleXML's object structure breaks if there a tag has "-" in the name. Do you happen to know if there is a work around? Thanks! For example, if "<characters>" tag was renamed "<main-characters>", then following would error: $xml->movie[0]->main-characters->character[0]->name <?xml version='1.0' standalone='yes'?> <movies> <movie> <title>PHP: Behind the Parser</title> <characters> <character> <name>Ms. Coder</name> <actor>Onlivia Actora</actor> </character> <character> <name>Mr. Coder</name> <actor>El Act&#211;r</actor> </character> </characters> <plot> So, this language. It's like, a programming language. Or is it a scripting language? All is revealed in this thrilling horror spoof of a documentary. </plot> <rating type="thumbs">7</rating> <rating type="stars">5</rating> </movie> </movies> ---- Manual Page -- http://www.php.net/manual/en/ref.simplexml.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+55009 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55009&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55009&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55009&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55009&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55009&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55009&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+55009&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#92286) next »