Re: LoadXML trouble

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Dec 11, 2007 3:52 AM, Dani Castaños <danitao.mailists@xxxxxxxxx> wrote:

> If i use your script like this:
>
> $xml = '<?xml version="1.0"?>
> <response>
>  <ticketID>1197027955_8310</ticketID>
>  <status>OK</status>
>  <errCode>200</errCode>
>  <errMsg></errMsg>
> </response>';
>
> $obj = new DOMDocument();
> $obj->loadXML( $xml );
>
> echo print_r( $obj, true );
> echo $obj->saveXML() . PHP_EOL;
>
> The first statement writes:
> DOMDocument Object
> (
> )
>
> The second:
> <?xml version="1.0"?>
> <response>
>  <ticketID>1197027955_8310</ticketID>
>  <status>OK</status>
>  <errCode>200</errCode>
>  <errMsg/>
> </response>
>
> It's just the xml is not properly stored in loadXML method... but the
> string must be inside due to saveXML returns the proper value.


that is expected behavior.  some of the internal classes dont define
any member variables that the php language has access to.  obviously
they are storing data internally, said variables just arent accessible as
member variables of the class thats being defined.
you can look at the structure of a class in one line with:
Reflection::export(new ReflectionClass('DomDocument'));

-nathan

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux