Content index to document index
Posted: Mon Nov 16, 2009 3:14 pm
Hi,
I'm pretty sure I've seen this issue covered, at least partially, in another post I read sometime back, but I can't find it, so sorry if I'm duplicating stuff here.
I and builidng an operation which shows the user a list of all tags of a certain type within the current document, and allows them to highligth the tags by clicking in the list. The list should also contain section of text which look liek they should be marked up with the tag. These section of text have been specified bya regular expression. I am currently extract the content of the doument as follows:
I can then run the rexex over this, and get a number of matches, with there start and end indexx into the content string.
What I can't do is convert this index into a index into the author document. As far as I recall the index into the author document is exssentially the same as that into the conetnt, with +1 for each tag. I really don't won't to have to construct this index by parsing the document node tree; is there an automated way to convert from a content index to a n author document index?
Thanks,
Simon.
I'm pretty sure I've seen this issue covered, at least partially, in another post I read sometime back, but I can't find it, so sorry if I'm duplicating stuff here.
I and builidng an operation which shows the user a list of all tags of a certain type within the current document, and allows them to highligth the tags by clicking in the list. The list should also contain section of text which look liek they should be marked up with the tag. These section of text have been specified bya regular expression. I am currently extract the content of the doument as follows:
Code: Select all
authorAccess.getDocumentController().getText(0, authorAccess.getDocumentController().getTextContentLength());
What I can't do is convert this index into a index into the author document. As far as I recall the index into the author document is exssentially the same as that into the conetnt, with +1 for each tag. I really don't won't to have to construct this index by parsing the document node tree; is there an automated way to convert from a content index to a n author document index?
Thanks,
Simon.