I'm trying to make a fairly simple inventory program that gets the data from xml.
Example of xml:
Right now I'm planning on trying to get all of that information into an arraylist if I can. I'm sure what the best way to organize the array(s) as but I was thinking having an array within an array, if that's possible, with an array for each category of items.
Also what I would like to do with that array is display it in a treeview and when you click on a node the attributes in the xml (or array) will appear in text boxes.
I'm not exactly sure where to start in something like this. I can read the xml and put it in the tree directly but that only solves half of the problem.
Maybe there's a better way to organize my xml?
Thanks for any help.
Example of xml:
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<inventory>
<category name="Bowls">
<category name="B3x4.5LID2">
<item code="B3x4.5LID2" desc="White Bowl w/ Lid 3x4.5" price="23.50" ondisplay="7/31/07" sold="no" />
<item code="B3x4.5LID2" desc="White Bowl w/ Lid 3x4.5" price="23.50" ondisplay="7/31/07" sold="8/10/07" />
</category>
<category name="B4x5LID2">
<item code="B4x5LID2" desc="Bowl w/ Lid 4x5" price="40.60" ondisplay="6/10/07" sold="no" />
<item code="B4x5LID2" desc="Bowl w/ Lid 4x5" price="40.60" ondisplay="6/10/07" sold="no" />
<item code="B4x5LID2" desc="Bowl w/ Lid 4x5" price="40.60" ondisplay="no" sold="no" />
<item code="B4x5LID2" desc="Bowl w/ Lid 4x5" price="40.60" ondisplay="no" sold="no" />
<item code="B4x5LID2" desc="Bowl w/ Lid 4x5" price="40.60" ondisplay="6/10/07" sold="6/20/07" />
<item code="B4x5LID2" desc="Bowl w/ Lid 4x5" price="40.60" ondisplay="6/10/07" sold="6/20/07" />
</category>
</category>
</inventory>
Right now I'm planning on trying to get all of that information into an arraylist if I can. I'm sure what the best way to organize the array(s) as but I was thinking having an array within an array, if that's possible, with an array for each category of items.
Also what I would like to do with that array is display it in a treeview and when you click on a node the attributes in the xml (or array) will appear in text boxes.
I'm not exactly sure where to start in something like this. I can read the xml and put it in the tree directly but that only solves half of the problem.
Maybe there's a better way to organize my xml?
Thanks for any help.