Re: php bug?
| From: | Rob Richards | Date: | Mon, 27 Sep 2010 11:29:55 +0000 |
| Subject: | Re: php bug? | ||
| References: | 1 2 3 | Groups: | php.xml.dev |
| Request: | Send a blank email to php-xml-dev+get-631@lists.php.net to get a copy of this message | ||
On 9/27/10 4:06 AM, mcberta2 wrote:
On 9/26/2010 6:34 PM, Adam Trachtenberg wrote:How about the full script as you don't include how/what you are passing to the title function. RobOn Sun, Sep 26, 2010 at 12:36 AM, mcberta2<mcberta2@googlemail.com> wrote:Thank you for coming to help. That's what I did. The routine can't get shorter than that. I attach now the xml file (shortest version). Just to be clear: <?xml version="1.0" encoding="utf-8"?> <messages> <message id="0">About us</message> <message id="1">Nothing has been ordered!</message> <message id="2">Continue shopping</message> <message id="3">Shopping cart</message> <message id="4">Contact us</message> <message id="5">News</message> <message id="6">Welcome</message> </messages> Am I referencing the nodes incorrectly? Thank you AndreaHello everyone. The following is an extract of a routine returning error messages from a xml file: function title($index) { $xml = simplexml_load_file("lingo.xml"); return $xml->message[$index]; } The problem is that if I call the routine with a value [ex. title(6)] I receive the message, whereas if I call the routine with a variable [ex. title($value) where $value=6] there is no way I can receive the message. I tried in many different ways but it looks like it's a bug of simple_xml.This isn't too helpful, but I'm 99.94% it's something in your code. Simplify your code until you find the shortest piece that works and then add back lines until you find your error. -adam