Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19872 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7984 invoked by uid 1010); 1 Nov 2005 07:51:22 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 7968 invoked from network); 1 Nov 2005 07:51:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Nov 2005 07:51:22 -0000 X-Host-Fingerprint: 212.55.202.210 host-210.bitflux.ch Linux 2.5 (sometimes 2.4) (4) Received: from ([212.55.202.210:3182] helo=devel.bitflux.ch) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id F8/2A-02082-87E17634 for ; Tue, 01 Nov 2005 02:51:21 -0500 Received: from localhost (localhost [127.0.0.1]) by devel.bitflux.ch (Postfix) with ESMTP id 3B96EE73BB; Tue, 1 Nov 2005 08:51:17 +0100 (CET) Received: from devel.bitflux.ch ([127.0.0.1]) by localhost (devel.bitflux.ch [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 20311-01-2; Tue, 1 Nov 2005 08:51:07 +0100 (CET) Received: from [192.168.84.92] (host-195.bitflux.ch [212.55.202.195]) by devel.bitflux.ch (Postfix) with ESMTP id 7E593E73C2; Tue, 1 Nov 2005 08:51:07 +0100 (CET) Message-ID: <43671E6B.4080309@bitflux.ch> Date: Tue, 01 Nov 2005 08:51:07 +0100 Organization: Bitflux GmbH User-Agent: Mozilla Thunderbird 1.0.7 (Macintosh/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Marian Kostadinov Cc: internals@lists.php.net References: <4365E1AA.4020602@bitflux.ch> <200511010921.04064.bu@orbitel.bg> In-Reply-To: X-Enigmail-Version: 0.92.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at bitflux.ch Subject: Re: [PHP-DEV] Is really no one interested? From: christian.stocker@bitflux.ch (Christian Stocker) On 1.11.2005 8:48 Uhr, Marian Kostadinov wrote: > Who says that I have a well-formed DTD? DTD is not necessary in many > cases. I will illustrate with example why DOM is too "complex" ... > compared to SimpleXML. > > //These are my 2 XML documents. No DTD - just a simple xml structure. > $xml1 = 'hi1'; > $xml2 = 'hi2'; > > $sxe1 = new SimpleXMLElement ($xml1); > $sxe2 = new SimpleXMLElement ($xml2); > > //Easy access to a node. It's great! > echo $sxe1->a->b->c->d; > echo $sxe2->a->b->c->d; > > //But how can I understand what is the name of the root node? > $dom_sxe = dom_import_simplexml($sxe1); > > //Hooray, we've got node name > echo $dom_sxe->nodeName; > > //And what happens if element sequence changes? . > echo $dom_sxe->childNodes->item(1)->firstChild->firstChild->firstChild->nodeValue; > //... hm... I prefer SimpleXML. use xpath :) as easy as simplexml and much more powerfull, IMHO and noone said you should use exclusively dom. chregu -- christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71 http://www.bitflux.ch | christian.stocker@bitflux.ch | GPG 0x5CE1DECB