Jump to:

23479 Posts in 18951 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Cant get nested xml values via restful service' getValues

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 760 Views
  • theoldlr
    Community Member
    103 Posts

    Cant get nested xml values via restful service' getValues Link to this post

    This section will properly get the xml response

    $directions = new RestfulService("http://maps.googleapis.com/maps/api/directions/xml");
    $params = array(
    'origin' => $data["Start"],
    'destination' => $this->Address,
    'sensor' => 'false'


    Here is where the trouble comes in:

    $HTMLStepsObjects=$directions->getValues($xmlResponse,$node, "html_instructions");

    //using searchValue as below works fine, but only gets 1 result, not all of them

    return $HTMLStepsObjects->Count();

    This will always return that there are 0 in the DataObjectSet, which means its not working right. Per the RestfulService API: When you get to the depth in the hierachchy use node_child_subchild syntax to get the value.
    I have tried this in many combinations:


    (I tried slashes because it worked for searchValue() ).

    Would really appreciate any advice! TIA!

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.