Check out the Xml test files (cake/tests/cases/libs/xml.test.php) for
usage

* Use App::import('Core', 'Xml');
* You need to instanciate an Xml object; you can't call it statically
  (since you called it statically from inside your controller, the `
$this` references inside correspond to the controller)
* Xml's constructor detects if the string is a path or raw xml and
handles it correctly

so...

function some_method() {
  App::import('Core', 'Xml');
  $channel = '';
  $xml = new Xml($channel);
  var_dump($xml);
}

hth
grigri

On Jun 10, 1:27 pm, avairet <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I'm trying to use the Xml class in a controller like that :
>
> public function MyMethod() {
>  App::import('Xml');
>  $channel = 'http://www.mywebsite.com/my_web_services/channel.php?
> ste_id=123456';
>  $doc = Xml::load($channel);
>  var_dump($doc);
>
> }
>
> But var_dump is not displayed because of a PHP error:
>
> Fatal error: Call to undefined method MyController::parse() in D:
> \developpements\frameworks\cake\actinext_2\cake\libs\xml.php on line
> 773
>
> Is it a Cake's core bug or an personnal error?
>
> Thks by advance for ideas about this issue.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to