I see.I already use the code with Xml you suggest me with a different way by using XPath and in the other way JPath for Json.both are smart ways of mapping ,by accessing children of Xml-Json so you dont have to create 2 types of views 1 for Xml and 1 for Json. Anyway thank you very much for your quick reply and suggestions!
2009/11/6 robustsolution <[email protected]> > > request handler deals with reading request header and setting response > header > > as for manipulation of the data as I know the cake 'Xml' library can > do it for xml data... example for parsing xml data as array > > App::import('Xml'); > $xml_instance =& new Xml(); > if ($xml_instance->load($xml_data)) { > $xml_parsed_as_array = Set::reverse($xml_instance); > debug($xml_parsed_as_array); > } > > as for json manipulation through at server side u can use the basic > json_encode/json_decode famous functions to convert PHP to json and > vice versa, and you can use the js helper or the javascript helper as > an alternative > > On Nov 5, 10:44 pm, Paulos23 <[email protected]> wrote: > > Hi people, > > I am bulding an app which supports web services,where the returned > > data may be XML or JSON.My idea is to create a component to handle > > both types of data.In particular i use HttpSocket to hit the specific > > url,then i take the data and finally i pass them to view.Now the > > question i have is if i can use RequestHandler Component for this > > approach,coz i don't want to generate XML, JSON but manipulate it and > > set it to view. > > > > Any help would ne nice! > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
