Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19873 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10710 invoked by uid 1010); 1 Nov 2005 08:04:49 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 10695 invoked from network); 1 Nov 2005 08:04:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Nov 2005 08:04:49 -0000 X-Host-Fingerprint: 195.24.32.29 vmail-1.orbitel.bg Linux 2.4/2.6 Received: from ([195.24.32.29:37977] helo=vmail-1.orbitel.bg) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 9C/6A-02082-1A127634 for ; Tue, 01 Nov 2005 03:04:49 -0500 Received: from localhost (mailprotection [10.0.0.2]) by vmail-1.orbitel.bg (Postfix) with ESMTP id F02338D6 for ; Tue, 1 Nov 2005 10:04:44 +0200 (EET) Received: from vmail-1.orbitel.bg ([10.0.0.1]) by localhost (sof-rv1.orbitel.bg [10.0.0.2]) (amavisd-new, port 10024) with ESMTP id 04121-89 for ; Tue, 1 Nov 2005 10:04:44 +0200 (EET) Received: from [192.168.1.10] (unknown [213.91.217.139]) by vmail-1.orbitel.bg (Postfix) with ESMTP id D8C36CE30 for ; Tue, 1 Nov 2005 10:04:41 +0200 (EET) Reply-To: bu@orbitel.bg To: internals@lists.php.net Date: Tue, 1 Nov 2005 10:04:33 +0200 User-Agent: KMail/1.8.2 References: <200511010921.04064.bu@orbitel.bg> In-Reply-To: X-Face: "c4tG*FY$8"*gUsm0B.S%v5*[!@-f4J`V@OaocG0\)x]-G`$Hy1#tWj~4VvL@6s X-Virus-Scanned: by amavisd-new at orbitel.bg Subject: Re: [PHP-DEV] Is really no one interested? From: bu@orbitel.bg (Petar Nedyalkov) --nextPart1311415.IKtUzeVota Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Tuesday 01 November 2005 09:48, 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. Well, If you are free to change the XML structure at any time - where's the= =20 point in wondering if an element is a parameter, a CDATA or an element? You= =20 can change everything to element and CDATA and that's all. If you have a=20 fixed XML structure, that's not supposed to change, having a DTD is=20 obligatory in orther to maintain consistency of the format.=20 So, you can either work without using getType (since you define the XML=20 structure yourself), or use a more complex API that will serve you well. > > //These are my 2 XML documents. No DTD - just a simple xml structure. > $xml1 =3D 'hi1'; > $xml2 =3D 'hi2'; > > $sxe1 =3D new SimpleXMLElement ($xml1); > $sxe2 =3D 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 =3D 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->nodeVa= lu >e; //... hm... I prefer SimpleXML. =2D-=20 Cyberly yours, Petar Nedyalkov Devoted Orbitel Fan :-) PGP ID: 7AE45436 PGP Public Key: http://bu.orbitel.bg/pgp/bu.asc PGP Fingerprint: 7923 8D52 B145 02E8 6F63 8BDA 2D3F 7C0B 7AE4 5436 --nextPart1311415.IKtUzeVota Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.7 (GNU/Linux) iD8DBQBDZyGYLT98C3rkVDYRAlLKAJ44IlLrDgCk3vSIg16e1BDhTC8oQACbBpwd cFGorCBQmndeYEbvoAGvdtw= =7b0W -----END PGP SIGNATURE----- --nextPart1311415.IKtUzeVota--