Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:4430 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71155 invoked by uid 1010); 8 Sep 2003 15:55:06 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 71128 invoked from network); 8 Sep 2003 15:55:05 -0000 Received: from unknown (HELO bambi.bitflux.ch) (212.71.97.156) by pb1.pair.com with SMTP; 8 Sep 2003 15:55:05 -0000 Received: from localhost (reh [127.0.0.1]) by bambi.bitflux.ch (Postfix) with ESMTP id DD3157F82D; Mon, 8 Sep 2003 17:55:04 +0200 (CEST) Received: from bambi.bitflux.ch ([127.0.0.1]) by localhost (bambi [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 31121-05-2; Mon, 8 Sep 2003 17:55:04 +0200 (CEST) Received: from bitflux.ch (bx-109.bitflux.ch [212.71.98.109]) by bambi.bitflux.ch (Postfix) with ESMTP id 75FD47F808; Mon, 8 Sep 2003 17:55:03 +0200 (CEST) Message-ID: <3F5CA657.4050807@bitflux.ch> Date: Mon, 08 Sep 2003 17:55:03 +0200 User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.5b) Gecko/20030902 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: John Huntjens Cc: internals@lists.php.net References: <20030908151120.7156.qmail@pb1.pair.com> <3F5C9D85.8010403@bitflux.ch> <20030908152504.28435.qmail@pb1.pair.com> In-Reply-To: <20030908152504.28435.qmail@pb1.pair.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-20030616-p3 (Debian) at bitflux.ch X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) Subject: Re: [PHP-DEV] dom_document_get_element_by_id From: chregu@bitflux.ch (Christian Stocker) On 9/8/03 5:25 PM, John Huntjens wrote: >>>Is this function working? >> >>yes. >> >>see: >> >>http://bugs.php.net/bug.php?id=17629 >>http://bugs.php.net/bug.php?id=16647 >> >>for details > > > I do not understand the workaround? > I am using latest cvs php5 you have to define the ids with a DTD. there are no default "id"-attributes in the XML-specs. Add: ]> to your XML document, and it should work. or use XPath to access the nodes: "//@id='id1'" chregu > > capitalizing the ID's to > > > > > > > > gives no result. > > Should I define a DTD to find the ID's? > > Gr, > > John > > > >>chregu >> >> >>>Test program: >>> >>>$dom = new domDocument(); >>>$dom->load("test.xml"); >>>$node = $dom->getElementById("id1"); >>>print_r($node); >>> >>>Test file: >>> >>> >>> >>> >>> >>> >>> >>>It seems to me that always a emty object is returned? >>> >> >>-- >>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 | chregu@bitflux.ch | gnupg-keyid 0x5CE1DECB > > -- 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 | chregu@bitflux.ch | gnupg-keyid 0x5CE1DECB