@Test() public void testXPathWithNS() throws IOException { Context context = new Context(); context.put("expression", "/bookstore/book"); EventDeserializer des = new XmlXpathDeserializer.Builder().build(context, getTestInputStream("ns.xml")); List<Event> events = des.readEvents(4); assertEquals(4, events.size()); for (final Event event : events) { assertNotNull(event); } }
@Override public List<Event> readEvents(int numEvents) throws IOException { ensureOpen(); List<Event> events = Lists.newLinkedList(); for (int i = 0; i < numEvents; i++) { Event event = readEvent(); if (event != null) { events.add(event); } } return events; }
XmlXpathDeserializer implements EventDeserializer { @Override public List<Event> readEvents(int numEvents) throws IOException { ensureOpen(); List<Event> events = Lists.newLinkedList(); for (int i = 0; i < numEvents; i++) { Event event = readEvent(); if (event != null) { events.add(event); } } return events; } }
XmlXpathDeserializer implements EventDeserializer { @Override public List<Event> readEvents(int numEvents) throws IOException { ensureOpen(); List<Event> events = Lists.newLinkedList(); for (int i = 0; i < numEvents; i++) { Event event = readEvent(); if (event != null) { events.add(event); } } return events; } XmlXpathDeserializer(Context context, ResettableInputStream in); }
XmlXpathDeserializer implements EventDeserializer { @Override public List<Event> readEvents(int numEvents) throws IOException { ensureOpen(); List<Event> events = Lists.newLinkedList(); for (int i = 0; i < numEvents; i++) { Event event = readEvent(); if (event != null) { events.add(event); } } return events; } XmlXpathDeserializer(Context context, ResettableInputStream in); @Override Event readEvent(); @Override List<Event> readEvents(int numEvents); @Override void mark(); @Override void reset(); @Override void close(); String nodeToString(Node node); String documentToString(Document document); }
XmlXpathDeserializer implements EventDeserializer { @Override public List<Event> readEvents(int numEvents) throws IOException { ensureOpen(); List<Event> events = Lists.newLinkedList(); for (int i = 0; i < numEvents; i++) { Event event = readEvent(); if (event != null) { events.add(event); } } return events; } XmlXpathDeserializer(Context context, ResettableInputStream in); @Override Event readEvent(); @Override List<Event> readEvents(int numEvents); @Override void mark(); @Override void reset(); @Override void close(); String nodeToString(Node node); String documentToString(Document document);  }