fetchind values of xml

Auudwumo

New Member
We are trying to fetch data for this META TAG - using the following XML AODB 2011-01-10T11:00:00 25 FLSH DALY The code is :\[code\]public List<Item> readConfig(String configFile) { List<Item> items = new ArrayList<Item>(); try { // First create a new XMLInputFactory XMLInputFactory inputFactory = XMLInputFactory.newInstance(); // Setup a new eventReader InputStream in = new FileInputStream(configFile); XMLEventReader eventReader = inputFactory.createXMLEventReader(in); // Read the XML document Item item = null; while (eventReader.hasNext()) { XMLEvent event = eventReader.nextEvent(); System.out.println("in while:::"); if (event.isStartElement()) { StartElement startElement = event.asStartElement(); //added if (startElement.getName().getLocalPart() == (Meta)) { item = new Item(); if (event.isStartElement()) { if (event.asStartElement().getName().getLocalPart() .equals(SUBT)) { event = eventReader.nextEvent(); item.setSubt(event.asCharacters().getData()); continue; } if (event.isEndElement()) { EndElement endElement = event.asEndElement(); if (endElement.getName().getLocalPart() == (Meta)) { items.add(item); } }\[/code\]but are not getting any output .
 
Back
Top