public void testCompositeTagWithAnotherTagChild() throws ParserException { String childtag = "<Another/>"; createParser("<Custom>" + childtag + "</Custom>"); parser.setNodeFactory( new PrototypicalNodeFactory( new Tag[] { new CustomTag(), new AnotherTag(true), })); parseAndAssertNodeCount(1); assertType("node", CustomTag.class, node[0]); CustomTag customTag = (CustomTag) node[0]; assertEquals("child count", 1, customTag.getChildCount()); assertFalse("custom tag should not be xml end tag", customTag.isEmptyXmlTag()); assertEquals("starting loc", 0, customTag.getStartPosition()); assertEquals("ending loc", 8, customTag.getEndPosition()); assertEquals("custom tag starting loc", 0, customTag.getStartPosition()); assertEquals("custom tag ending loc", 27, customTag.getEndTag().getEndPosition()); Node child = customTag.childAt(0); assertType("child", AnotherTag.class, child); AnotherTag tag = (AnotherTag) child; assertEquals("another tag start pos", 8, tag.getStartPosition()); assertEquals("another tag ending pos", 18, tag.getEndPosition()); assertEquals("custom end tag start pos", 18, customTag.getEndTag().getStartPosition()); assertStringEquals("child html", childtag, child.toHtml()); }