phpbar.de logo

Mailinglisten-Archive

[php] PHP 4 --with-dom

[php] PHP 4 --with-dom

=?iso-8859-1?Q?Bj=F6rn_Schotte?= bjoern_(at)_baer.main.de
Tue, 4 Apr 2000 22:17:49 +0200


* Benjamin Billian wrote:
> Was bringt die Option denn eigentlich ???

Das Einbinden der Gnome libxml. Mittels folgendem
PHP-Code (danke an Tobias :) läßt sich der Grundstein
z.B. für ein RSS-File legen:

<?php
$doc = new_xmldoc("1.0");

$root = $doc->add_root("rss");
$root->setattr("version", "0.91");

$channel = $root->new_child("channel", "");
$channel->new_child("title", "XML News and Features from XML.com");
$channel->new_child("description", "XML.com features a rich mix of information an");
$channel->new_child("language", "en-us");
$channel->new_child("link", "http://xml.com/pub");
$channel->new_child("copyright", "Copyright 1999, O'Reilly and Associates and Sey");
$channel->new_child("managingEditor", "dale_(at)_xml.com (Dale Dougherty)");
$channel->new_child("webMaster", "peter_(at)_xml.com (Peter Wiggin)");

$image =$channel->new_child("image", "");
$image->new_child("title", "XML News and Features from XML.com");
$image->new_child("url", "http://xml.com/universal/images/xml_tiny.gif");
$image->new_child("link", "http://xml.com/pub");
$image->new_child("width", "88");
$image->new_child("height", "31");

print nl2br(htmlspecialchars($doc->dumpmem()));
?>
-- 
Björn Schotte                        Fon: 0931 / 78 43 79 2
<http://www.php-center.de/>          Fax: 0931 / 78 43 79 5
<http://www.web-cards.de/>


php::bar PHP Wiki   -   Listenarchive