Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Strange XML structrue after Facebook call.

$
0
0
I am trying to access profile data via the Facebook Graph Api like described here:

I have to say. I am very unexperienced with XML. 
So this might be a real noob question.


what I get is an XMLElemn which looks like this:

  1. <<?xml version="1.0" encoding="UTF-8"?>
  2. <Users_getInfo_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd" list="true">
  3.   <user>
  4.     <uid>1477411208</uid>
  5.     <first_name>Marc</first_name>
  6.     <last_name>Tiedemann</last_name>
  7.   </user>
  8. </Users_getInfo_response>/>

looks good to me. but when I try to access the children, i get null back!
instead everything seems to be root!

  1.         println("childs "+ xml.hasChildren());
  2.         println("root "+ xml.getName());

console output:
  1. childs false
  2. root <?xml version="1.0" encoding="UTF-8"?>
  3. <Users_getInfo_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd" list="true">
  4.   <user>
  5.     <uid>1477411208</uid>
  6.     ...


I also read that this method of getting info from the Graph API is kinda outdated. As REST got depriciated.
Does anybody have a running example of how you could do this better?
As said I am very very new to this kind of coding and happy for any hint's in the right direction. 



Viewing all articles
Browse latest Browse all 1768

Trending Articles