public void testElementCountNested()
throws XMLStreamException
{
SMInputFactory sf = new SMInputFactory(XMLInputFactory.newInstance());
String XML = "<root><!--comment--><a>text</a><?pi?><leaf /></root>";
SMInputCursor rootc = sf.rootElementCursor(new StringReader(XML)).advance();
// let's traverse using element cursor, to skip comment
SMInputCursor crsr = rootc.childElementCursor();
assertEquals(0, crsr.getElementCount());
// should skip over comment, bump into element
assertToken(SMEvent.START_ELEMENT, crsr.getNext());