assertEquals( "paragraph", it.next().getName() );
assertEquals( "bold", it.next().getName() );
assertEquals( "text", it.next().getName() );
assertEquals( "bold_", it.next().getName() );
SinkEventElement el = it.next();
assertEquals( "text", el.getName() );
assertEquals( " ", (String) el.getArgs()[0] );
assertEquals( "italic", it.next().getName() );
assertEquals( "text", it.next().getName() );
assertEquals( "italic_", it.next().getName() );
assertEquals( "paragraph_", it.next().getName() );
assertFalse( it.hasNext() );
// same test with EOL
String eol = System.getProperty( "line.separator" );
text = "<p><b>word</b>" + eol + "<i>word</i></p>";
sink.reset();
parser.parse( text, sink );
it = sink.getEventList().iterator();
assertEquals( "paragraph", it.next().getName() );
assertEquals( "bold", it.next().getName() );
assertEquals( "text", it.next().getName() );
assertEquals( "bold_", it.next().getName() );
el = it.next();
assertEquals( "text", el.getName() );
// according to section 2.11 of the XML spec, parsers must normalize line breaks to "\n"
assertEquals( "\n", (String) el.getArgs()[0] );
assertEquals( "italic", it.next().getName() );
assertEquals( "text", it.next().getName() );
assertEquals( "italic_", it.next().getName() );
assertEquals( "paragraph_", it.next().getName() );
assertFalse( it.hasNext() );
// DOXIA-189: there should be no EOL after closing tag
text = "<p>There should be no space after the last <i>word</i>.</p>";
sink.reset();
parser.parse( text, sink );
it = sink.getEventList().iterator();
assertEquals( "paragraph", it.next().getName() );
assertEquals( "text", it.next().getName() );
assertEquals( "italic", it.next().getName() );
assertEquals( "text", it.next().getName() );
assertEquals( "italic_", it.next().getName() );
el = it.next();
assertEquals( "text", el.getName() );
assertEquals( ".", (String) el.getArgs()[0] );
assertEquals( "paragraph_", it.next().getName() );
assertFalse( it.hasNext() );
}