Re: [PHP-XML-DEV] xml:id and getElementById Issue

[email protected] (Rob Richards) Wed, 16 Mar 2005 16:32:18 -0500
Newsgroups php.xml.dev
Message-ID <[email protected]>
C Drozdowski wrote:

> As per the discussion at 
> http://blog.bitflux.ch/wiki/Talk:GetElementById_Pitfalls, 
> DOMDocument::getElementByID() doesn't work with xml:id if the 
> DOMDocument is being created in code.
>
> It only works when the document is either loaded from a string or from 
> a file.
>
> As per the discussion, this is an issue with libxml2. As of 
> libxml2.6.17, it still doesn't work.

And will never work that way. IDs would need to be set using the 
DOMElement setIdAttribute methods, but these aren't currently 
implemented as there are some libxml issues surrounding this.

Rob