commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luke Shannon" <>
Subject Re: Digester Quesion
Date Tue, 08 Feb 2005 20:27:14 GMT
Hi Wendy;

I need a little more advice. It seems I now need more than the item tag.

Here is a full xml sample:

  <TYPES />
  <ITEM NAME="category" TYPE="text">Category 4</ITEM>
  <ITEM NAME="provider" TYPE="text">luke</ITEM>
  <ITEM NAME="progress_ref" TYPE="text">1100816505287</ITEM>
  <ITEM NAME="name" TYPE="text">ppt</ITEM>
  <ITEM NAME="desc" TYPE="text">dsfds</ITEM>
    <ITEM NAME="sort" TYPE="text">8</ITEM>
    <!-- an item like this one is optional -->
  <ITEM DIR="donutwars.ppt" HEIGHT="-1" NAME="kcfileupload" SIZE="9728"
STYPE="file" TYPE="upload" WIDTH="-1">donutwars.ppt</ITEM>

>From this I need:

1. As before a TreeMap containing @NAME (map key) and the value of the item
tag (map value).
2. If there is a SIZE attribute I need it.
3. I need the TYPE value now too.

What do you reccomend? Create a DATA object which contains a TreeMap for the
ITEMs, size variable for SIZE (if there is one) and a type variable for

Any tips you can give me would be great.


----- Original Message ----- 
From: "Wendy Smoak" <>
To: "Jakarta Commons Users List" <>
Sent: Monday, February 07, 2005 3:27 PM
Subject: Re: Digester Quesion

> From: "Luke Shannon"
> > What I end up back is a TreeMap containing the value of the ITEM@name as
> the
> > Map key and the value of <ITEM> as the Map value. Things were running
> > smoothly until I was told today that some <ITEM> contain a size
> > Example:
> >
> >  <ITEM DIR="air3.pdf" HEIGHT="-1" NAME="kcfileupload" SIZE="117960"
> > STYPE="file" TYPE="upload" WIDTH="1">air3.pdf</ITEM>
> Right now you have a Map where the key/value pair is String/String,
> And in the example above, you're currently _only_ storing the 'NAME'
> attribute, and whatever is in the body of the <ITEM> tag?
> Didn't I talk you out of having an 'Item' class last week?  Looks like you
> need it again!  If an 'item' has more properties, it seems to me like
> need an Item 'bean', with get/set methods for the various properties.
> If you create an Item when you see DATA/VERSION/ITEM, then you can use the
> Item as the second parameter to 'put' on the TreeMap.  I have an example
> something similar-- it creates an ArrayList of LazyDynaBeans, you should
> able to adapt it to creating a TreeMap of Items.
> -- 
> Wendy Smoak
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message