PHP Classes


Recommend this page to a friend!

      Top level forums  >  PHP Specialists  >  General  >  SimpleXML  
Summary:Problem parsing data
Author:Neil McGibbon
Date:2009-02-18 20:55:45
Update:2009-02-20 10:35:17

  1. SimpleXML   Reply   Report abuse  
Neil McGibbon - 2009-02-18 22:30:41
Hi there,

I have a question regarding SimpleXML - and why it deosn't retrieve all nodes, from the XML located at ''.

If I view the XML, I can see the data correctly. If I try view the XML after simplexml has loaded the data, not all of it displays. Please see my two entries below. This xml has many child nodes "game" with various child nodes.

THe first one is the XML for one "Game" node, the second past is the SimpleXML var_dump for the same "Game" node:

<game id="3500090" date="20090218" time="2200">
<category id="TENMENINTINTATP" order="31300">ATP Tour</category>
Haas Tommy - Querrey Sam
<type id="0"/>
<alternative odds="1.65" team="5659">1</alternative>
<alternative odds="0.00" team="5659">X</alternative>
<alternative odds="2.20" team="76376">2</alternative>

SimpleXML Object

array(2432) {
object(SimpleXMLElement)#2 (4) {
array(3) {
string(7) "3500090"
string(8) "20090218"
string(4) "2200"
object(SimpleXMLElement)#2434 (1) {
string(8) "ATP Tour"
object(SimpleXMLElement)#2435 (1) {
array(1) {
string(1) "0"
object(SimpleXMLElement)#2436 (1) {
array(3) {
string(1) "1"
string(1) "X"
string(1) "2"

As you can see, the atributes for "category" are missing, as is the text data for "description" as well as the atributes in each of the "alternative" nodes?

Can anyone shed any light on this at all?



There are 3 replies in this thread, which are not being displayed.
Browsing this forum thread replies is available only to premium subscribers.

Go to the premium subscriptions page to learn how to become a premium subscriber and have full access to this forum.