1 import java.util.ArrayList;
2
3 /**
4 This program parses an XML file containing an item list.
5 It prints out the items that are described in the XML file.
6 */
7 public class ItemListParserDemo
8 {
9 public static void main(String[] args) throws Exception
10 {
11 ItemListParser parser = new ItemListParser();
12 ArrayList<LineItem> items = parser.parse("items.xml");
13 for (LineItem anItem : items)
14 {
15 System.out.println(anItem.format());
16 }
17 }
18 }