For some applications it would be helpful to have a way to map a given node back to its corresponding span(s) in the source XML. We could add an optional map argument to the parse options that can be populated with a mapping of nodes to such position information.
TODO:
[ ] extend internal parse events with position information where necessary
[ ] decide which spans to expose for which nodes:
[ ] text nodes may be actual character data + references, should these be a single span or multiple?
[ ] elements have a start and end - single span including contents or separate spans for start and end tags
[ ] what about attributes?
[ ] other bits of data? names?
[ ] add option
[ ] convenience methods to translate start and end offsets to column + line?
For some applications it would be helpful to have a way to map a given node back to its corresponding span(s) in the source XML. We could add an optional map argument to the parse options that can be populated with a mapping of nodes to such position information.
TODO: