previous
|
start
|
next
Parsing XML Documents: An Example
ItemListParser
parses an XML document with a list of product descriptions
Uses the
LineItem
and
Product
parse
takes the file name and returns an array list of
LineItem
objects:
ItemListParser parser = new ItemListParser(); ArrayList<LineItem> items = parser.parse("items.xml");
ItemListParser
translates each XML element into an object of the corresponding Java class
previous
|
start
|
next