incorrect line and column numbers
Created by: mattoshry
Running the following document through scxml-to-scjson:
<scxml xmlns="http://www.w3.org/2005/07/scxml"
version="1.0"
initial="s1">
<datamodel>
<data id="counter"
expr="0"/>
</datamodel>
<state id="s1">
<transition target="pass"/>
</state>
<final id="pass"/>
</scxml>
yields the following {local.name, line, and column}:
onopentag scxml 2 15
onopentag datamodel 4 11
onopentag data 6 14
onopentag state 9 15
onopentag transition 10 29
onopentag final 13 18
Intuitively one would expect the line and column to reflect the location of the beginning of the start tag:
onopentag scxml 1 8
onopentag datamodel 5 12
onopentag data 6 9
onopentag state 10 8
onopentag transition 11 15
onopentag final 14 8
There are a couple of issues here:
- The SAX module provides line and column info using offset 0.
- The SAX module updates the line and column when it encounters a
\n
which, as demonstrated in the above example, may occur before theonopentag
event is emitted after all the attributes of the tag are consumed.