xml parsing problem

2009-06-12 Thread robert123

i am using the below codes, took from the bakery, straight

 App::import('Xml');

// your XML file's location
$file = my_xml_file.xml;

// now parse it
$parsed_xml = new XML($file);
$parsed_xml = Set::reverse($parsed_xml); // this is what i call
magic

// see the returned array
   var_dump($parsed_xml);
 it shows
array(1) { [Order]=  array(1) { [id]=  string(7) 3525314 } }

the  my_xml_file.xml have the data below

order id=3525314 /orderorder id=3525317 /order

it has two order data, the my_xml_file.xml was generated from the
database using $xml-serialize($data);

but whenever the code above is executed I only get
Array ( [Order] = Array ( [id] = 3525314 ) )

that is it is only reads the first order and never the second order,
how can i make it to read the whole xml data into an array, thank you




http://www.generics.ws
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: xml parsing problem

2009-06-11 Thread paulos nikolo
Try use the var_dump() or debug().I had the same problem and i am using the
debug().To be more specific here is some code which might help you:

$results = 
$parsed_xml = new XML($results);
$parsed_xml = Set::reverse($parsed_xml);
debug($results); (or var_dump($results))

2009/6/11 robert123 generics...@gmail.com


 i am using the below codes, took from the bakery, straight

  App::import('Xml');

// your XML file's location
$file = my_xml_file.xml;

// now parse it
$parsed_xml = new XML($file);
$parsed_xml = Set::reverse($parsed_xml); // this is what i call
 magic

// see the returned array
print_r($parsed_xml);

 the  my_xml_file.xml have the data below

 order id=3525314 /orderorder id=3525317 /order

 it has two order data, the my_xml_file.xml was generated from the
 database using $xml-serialize($data);

 but whenever the code above is executed I only get
 Array ( [Order] = Array ( [id] = 3525314 ) )

 that is it is only reads the first order and never the second order,
 how can i make it to read the whole xml data into an array, thank you





 http://www.generics.ws


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: xml parsing problem

2009-06-11 Thread robert123

when i did
var_dump($parsed_xml);  it shows
array(1) { [Order]=  array(1) { [id]=  string(7) 3525314 } }

hence when the xml was parsed to array only one record is stored into
the array, my question is anyone knows how to get the 2 records into
an array? Thank you

On Jun 11, 4:48 pm, paulos nikolo paulitosthe...@gmail.com wrote:
 Try use the var_dump() or debug().I had the same problem and i am using the
 debug().To be more specific here is some code which might help you:

 $results = 
         $parsed_xml = new XML($results);
         $parsed_xml = Set::reverse($parsed_xml);
         debug($results); (or var_dump($results))

 2009/6/11 robert123 generics...@gmail.com



  i am using the below codes, took from the bakery, straight

   App::import('Xml');

     // your XML file's location
     $file = my_xml_file.xml;

     // now parse it
     $parsed_xml = new XML($file);
     $parsed_xml = Set::reverse($parsed_xml); // this is what i call
  magic

     // see the returned array
     print_r($parsed_xml);

  the  my_xml_file.xml have the data below

  order id=3525314 /orderorder id=3525317 /order

  it has two order data, the my_xml_file.xml was generated from the
  database using $xml-serialize($data);

  but whenever the code above is executed I only get
  Array ( [Order] = Array ( [id] = 3525314 ) )

  that is it is only reads the first order and never the second order,
  how can i make it to read the whole xml data into an array, thank you

 http://www.generics.ws
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



xml parsing problem

2009-06-10 Thread robert123

i am using the below codes, took from the bakery, straight

 App::import('Xml');

// your XML file's location
$file = my_xml_file.xml;

// now parse it
$parsed_xml = new XML($file);
$parsed_xml = Set::reverse($parsed_xml); // this is what i call
magic

// see the returned array
print_r($parsed_xml);

the  my_xml_file.xml have the data below

order id=3525314 /orderorder id=3525317 /order

it has two order data, the my_xml_file.xml was generated from the
database using $xml-serialize($data);

but whenever the code above is executed I only get
Array ( [Order] = Array ( [id] = 3525314 ) )

that is it is only reads the first order and never the second order,
how can i make it to read the whole xml data into an array, thank you





http://www.generics.ws


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---