note 55009 rejected from ref.simplexml by betz
| From: | betz@php.net | Date: | Fri, 22 Jul 2005 10:54:54 +0000 |
| Subject: | note 55009 rejected from ref.simplexml by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-92293@lists.php.net to get a copy of this message | ||
Note Submitter: elin at unitboy dot com
----
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Ó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>