NodeIterator { public boolean nextIsXliffElement() { if (next == null) { return false; } return (next instanceof Element) && (Schemas.XLIFF_12_NAMESPACE.equals(next.getNamespaceURI())); } NodeIterator(List<? extends Node> nodes, boolean ignoreWhitespaceText); boolean hasNext(); boolean nextIsText(); boolean nextIsElement(); boolean nextIsXliffElement(); boolean nextIsXliffElement(String localName); boolean nextIsNonXliffElement(); String getText(); Element getElement(); Element getXliffElement(); Element getNonXliffElement(); Element getXliffElement(String localName); void assertNoMoreNodes(); Element getXliffElement(String... localNames);  }
@Test public void testNextIsXliffElement() throws ConstraintViolationException { NodeIterator ni; ArrayList<Node> nodes = new ArrayList<Node>(); Document doc = Utils.createDocument(); ni = new NodeIterator(nodes, false); assertFalse(ni.nextIsXliffElement()); nodes.add(doc.createElementNS("ns", "name")); nodes.add(doc.createElementNS(XLIFF_12_NAMESPACE, "name")); nodes.add(doc.createTextNode("abc")); ni = new NodeIterator(nodes, false); assertFalse(ni.nextIsXliffElement()); ni.getElement(); assertTrue(ni.nextIsXliffElement()); ni.getElement(); assertFalse(ni.nextIsXliffElement()); }