Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: newbie question for XML.. why array == 1st element

From: Summercool <Summercoolness@-----.--->
To: NULL
Date: 3/1/2008 9:44:00 AM
On Feb 29, 11:51 pm, petersprc <peters...@gmail.com> wrote:
> Hi,
>
> This is because simple XML nodes are stored internally as objects in a
> linked list.
>
> When you use the arrow (->) operator, the first matching child is
> returned by the read_property object handler.
>
> When all of a node's properties are fetched as a result of executing
> print_r, children with the same name are combined into an array by the
> get_properties object handler.
>
> SimpleXMLElement implements the Travesable interface, which allows you
> to iterate over these objects using foreach.
>
> More info on object handler functions is here:http://www.php-mag.net/magphpde/magphpde_article/psecom,id,382,nodeid...


that's interesting...  so in other words... if i pass $xml->note  to a
function, the memory of exactly 1 node is passed.

in other language... a linked list will have a member variable $next
that explicitly points to the next member...

so in PHP, it looks like a node, without having a $next... and yet it
is a linked list.

and print_r will print it as an Array type.



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent