You are here: Re: XML create with PHP 5 help « PHP Programming Language « IT news, forums, messages
Re: XML create with PHP 5 help

Posted by Gary Quiring on 10/02/58 11:16

On Wed, 18 May 2005 15:14:36 +0200, Azeus <IFARTINYOURGENERALDIRECTION@MP.com>
wrote:

>Try the following Dom syntax:
>And try to put some of your own stuff in it.
>
>
>/* Dom document */
>$dom = new DOMDocument("1.0","iso-8859-1");
>
>
>/* Create all elements */
>$response = $dom->createElement("response"); //root element
>$data = $dom->createElement("data");
>$parts = $dom->createElement("parts");
>$part = $dom->createElement("parts");
>$number = $dom->createElement("number","bla");
>$price = $dom->createElement("price", "9999");
>
>/* Now place them in the correct place in the tree */
>
>$response->appendChild($data);
>$data->appendChild($parts);
>$parts->appendChild($part);
>$part->appendChild($number);
>$part->appendChild($price);
>
>$dom->appendChild($response);
>
>echo $dom->saveXML();
>
What output should I see on the browser? I only see bla9999. It does not show
the XML file with the tags?

Thanks
Gary

 

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

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