Element testXML = XMLBuilder.build("<a>012345678<b>9" +
"0</b>1234<c>5</c>6789" +
"<d>0<e>1</e>2</d>3<d><e>45</e>6</d>789" +
"01<f><g>23</g></f>456<i/>789</a>", "/localhost").getRootElement();
XMLSpanTagger.tagUpDocument(testXML, "a");
StandoffTable st = new StandoffTable(testXML);
assertEquals("At /1/1.1", 1, st.getOffsetAtXPoint("/1/1.1"));
assertEquals("At /1/1.8", 8, st.getOffsetAtXPoint("/1/1.8"));
assertEquals("At /1/1.9", 9, st.getOffsetAtXPoint("/1/1.9"));
assertEquals("At /1/2/1.1", 10, st.getOffsetAtXPoint("/1/2/1.1"));
assertEquals("At /1/2/1.2", 11, st.getOffsetAtXPoint("/1/2/1.2"));
assertEquals("At /1/5.3", 19, st.getOffsetAtXPoint("/1/5.3"));
assertEquals("At /1/5.4", 20, st.getOffsetAtXPoint("/1/5.4"));
assertEquals("At /1/6/1.1", 21, st.getOffsetAtXPoint("/1/6/1.1"));
assertEquals("At /1/6/2/1.1", 22, st.getOffsetAtXPoint("/1/6/2/1.1"));
assertEquals("At /1/6/3.1", 23, st.getOffsetAtXPoint("/1/6/3.1"));
assertEquals("At /1/7.1", 24, st.getOffsetAtXPoint("/1/7.1"));
assertEquals("At /1/8/1/1.1", 25, st.getOffsetAtXPoint("/1/8/1/1.1"));
assertEquals("At /1/8/1/1.2", 26, st.getOffsetAtXPoint("/1/8/1/1.2"));
assertEquals("At /1/1.0", 0, st.getOffsetAtXPoint("/1/1.0"));
assertEquals("At /1/1.1", 1, st.getOffsetAtXPoint("/1/1.1"));
assertEquals("At /1/1.8", 8, st.getOffsetAtXPoint("/1/1.8"));
assertEquals("At /1/2/1.0", 9, st.getOffsetAtXPoint("/1/2/1.0"));
assertEquals("At /1/2/1.1", 10, st.getOffsetAtXPoint("/1/2/1.1"));
assertEquals("At /1/3.0", 11, st.getOffsetAtXPoint("/1/3.0"));
assertEquals("At /1/5.3", 19, st.getOffsetAtXPoint("/1/5.3"));
assertEquals("At /1/6/1.0", 20, st.getOffsetAtXPoint("/1/6/1.0"));
assertEquals("At /1/6/2/1.0", 21, st.getOffsetAtXPoint("/1/6/2/1.0"));
assertEquals("At /1/6/3.0", 22, st.getOffsetAtXPoint("/1/6/3.0"));
assertEquals("At /1/7.0", 23, st.getOffsetAtXPoint("/1/7.0"));
assertEquals("At /1/8/1/1.0", 24, st.getOffsetAtXPoint("/1/8/1/1.0"));
assertEquals("At /1/8/1/1.1", 25, st.getOffsetAtXPoint("/1/8/1/1.1"));
assertEquals("At /1/8/2.0", 26, st.getOffsetAtXPoint("/1/8/2.0"));
}