You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by ch...@kodak.com on 2002/04/25 03:11:47 UTC

getElementById() method

From: Chandra Swaminathan

Hi,

I needed to use the functionality provided by the getElementById() method.
But, since I am constructing an XML document dynamically and need to search
for an element using the ID attribute that I added earlier, it does not
work.

I searched through the archives of xerces-c-dev and found that there was a
discussion precisely along these lines some time ago.  One person suggested
that the problem was that the ID table in the document is not being updated
when an element is added and that it is updated only when the document is
parsed. Another person (Evert Haasdijk) posted a potential fix that he uses
(his modification to the code) to address this problem.

Here is a link to the discussion thread in the archive ->
"http://marc.theaimsgroup.com/?l=xerces-c-dev&m=99439569509068&w=2"

I am new to this list, but the ability to use getElementById() this way
would be extremely useful.

I am wondering if Evert's fix can be added to the code.  Evert are you a
committer? If not can one of the committers take a look at this issue and
comment on it.

Thank you.

Chandra.




---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: getElementById() method

Posted by Arnaud Le Hors <le...@us.ibm.com>.
I just added something similar to Xerces-J, it's a method called
setIdAttributeNode() on Element that one can use to make any attribute
an ID attribute that is being maintained accordingly by the
implementation. It would be good if somebody could port it to Xerces-C.

I also launched a discussion on this within the W3C DOM WG to seek a
standard API but I'm not sure what will come out of it as there are
issues with how this works in combination with grammars (DTDs and
Schemas).
-- 
Arnaud  Le Hors - IBM, XML Standards Strategy Group / W3C AC Rep.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org