Re: Identifying HTML DOM elements
skaushik_at_hotmail.com
Date: 12/15/04
- Next message: Curedone: "Date/time formatted input controls"
- Previous message: Santino: "getting the IHTMLElement before (adjacent to) the TextRange"
- In reply to: Igor Tandetnik: "Re: Identifying HTML DOM elements"
- Messages sorted by: [ date ] [ thread ]
Date: 14 Dec 2004 17:05:40 -0800
> > Given an HTML DOM of a Web page, is the value of an
> > IHTMLDOMNode pointer for an element guaranteed to remain
> > the same, regardless of how the pointer is obtained?
> > In other words, can I compare two IHTMLDOMNode pointer
> > values and conclude that they refer to the same element?
>
> You should be able to, but you must use COM identity comparison. That
> is, explicitly QI both pointers for IUnknown, and compare resulting
> IUnknown pointers.
Well, I did not explicity QI for IUnknown, but the two pointers
being compared were of the same type (IHTMLDOMNode).
Incidentally, I just found out about this interface called
IHTMLUniqueName. Callinh IHTMLUniqueName::get_uniqueID() returns a
unique string for each element and I can use that for comparison,
but I'd much rather aviod a method call if I can get by with a
pointer comparison.
While we are on the topic, is there a way to tell whether a given
HTML DOM node p appears before or after another node q?
("Before" and "after" here are of course with respect to a
top-down, left-right traversal of the DOM tree.)
Thanks,
-K
- Next message: Curedone: "Date/time formatted input controls"
- Previous message: Santino: "getting the IHTMLElement before (adjacent to) the TextRange"
- In reply to: Igor Tandetnik: "Re: Identifying HTML DOM elements"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|