You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by Scott Dewitt <de...@us.ibm.com> on 2001/02/24 02:57:18 UTC

DOM node->text location mapping

I am implementing an XML viewer that has a DOM view and a source view. I
would like to be able to maintain a DOM node to text location mapping so
that I can implement synchronization of selection and changes between the
two panes. In order to do this, I need a way to obtain the *exact* current
line and column number information from an instance of a DOMParser so that
I can construct a mapping. Is this possible? I know that I can use the
org.xml.sax.Locator to get approximations, but I need exact locations for
the purposes of editing the XML source. I am using Xerces 1.3 and haven't
found any way to obtain accurate line and column number information. Any
help would be much appreciated. Thanks, Scott

-==================================================-
Scott DeWitt                IBM WebSphere Transcoding Publisher
dewittsc@us.ibm.com
(919) 486.1919   t/l 526.1919
-==================================================-