You are here: Re: Simple xml extension « PHP Programming Language « IT news, forums, messages
Re: Simple xml extension

Posted by frodo2000@gmail.com on 07/16/07 11:11

On 16 Lip, 11:36, David Gillen <Bel...@RedBrick.DCU.IE> wrote:
> Hello.
>
> I'm looking to create xml like the following
>
> <node>
> <otherNode>foo</otherNode>
> <otherNode>bar</otherNode>
> <otherNode>moo</otherNode>
> </node>
> via the simple xml interface.
> Unfortunately I cannot figure out how to create multiple nodes with the same
> name as children of the parent, sibling as it were. Is this actually possible
> using PHPs simple xml extension?
>
> Doing
> $node->otherNode = foo;
> $node->otherNode = bar;
> etc just overwrite the previous value.
>
> Thanks,
> D.
> --
> Fermat was right.

Try

$node->otherNode = array();
$node->otherNode[] = foo;
$node->otherNode[] = bar;

or use addChild function: http://uk3.php.net/manual/pl/function.simplexml-element-addChild.php

----
Marcin

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация