Perhaps you could take a page from IBM Bookmaster, which defines a SPOT
element which basically exists to allow an ID to be inserted at a random place
in a document. Then you could do something like this:
<highlight from=spot01 until=spot04>
.
.
.
<spot id=spot01>
.
.
.
<spot id=spot04>
At least then you wouldn't need byte offsets, or line numbers, or other
error-prone mechanisms.
Michael Johnson
Relay Technology, Inc.