[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.webtools] Re: Getting the Node given an ITextRegion

Nitin Dahyabhai wrote:
Not a simple way, no. The IndexedRegion is a generic interface for mapping objects to document offsets, not specific to any language that's implemented, and for the XML DOM it's done with child nodes of the document, not with their attribute nodes. Once you have the main node, however, getting its attributes and using the offset information through the IDOMAttr interface should get you where you want to go. Directly comparing the name and value text regions of an Attr node against those returned through the IDOMNode interface may also work.

Thanks Nitin. I managed to get the IDOMAttr after getting the node by first checking to make the sure the node was in the namespace I expected and then getting the attribute by name, and comparing it's IDOMAttr ValueRegion ITextArea#getStart to the ITextArea#getStart I had. So basically, I now I have a convoluted way of getting a node based on the ITextRegion.


Thanks for the tip.