Re: dom_document_get_element_by_id
| From: | John Huntjens | Date: | Mon, 08 Sep 2003 15:25:03 +0000 |
| Subject: | Re: dom_document_get_element_by_id | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-4429@lists.php.net to get a copy of this message | ||
> > 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
capitalizing the ID's to
<?xml version="1.0" encoding="utf-8"?>
<test>
<el1 ID="id1"/>
<el2 ID="id2"/>
</test>
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:
> >
> > <?xml version="1.0" encoding="utf-8"?>
> > <test>
> > <el1 id="id1"/>
> > <el2 id="id2"/>
> > </test>
> >
> > 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