commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philip A Grim II" <pg...@data-tactics.com>
Subject [digester] Trouble adding a list to a hash map
Date Fri, 01 Oct 2010 19:12:42 GMT
I'm having difficulty with the Digester when trying to add a list to a hash
map.

The following is a portion of the XML I'm digesting:

 

<?xml version=\"1.0\" encoding=\"utf-8\"?>

<Envelope>

  <Person>

    <Locations>

      <Location>

        <Id>3eca4cd1-a07a-4013-b4a3-1d6a6530f7e3</Id>

        <DateAsOf>201007132112</DateAsOf>

        <DateLastModified>20100803203509203</DateLastModified>

        <Name>Most Recent Location</Name>

        <WKT>POINT (69.568583399873617 33.86775960347174 0)</WKT>

      </Location>

      <Location>

        <Id>3e2462d1-a0c7-4013-4523-1345a3b8f7e3</Id>

        <DateAsOf>201007100814</DateAsOf>

        <DateLastModified>20100803203509203</DateLastModified>

        <Name>Previous Location</Name>

        <WKT>POINT (66.53455434533617 32.863453455537174 0)</WKT>

      </Location>

    </Locations>

  </Person>

</Envelope>

 

The top level object is a HashMap that contains properties of the Person
tag.  Simple properties work fine, but nested properties such as Locations
are what are giving me trouble.  I am trying to create an ArrayList of the
Location tags which contains a HashMap of the properties nested inside each
Location tag, and that part works, but when I try to add that ArrayList to
the HashMap of person properties, I get an empty list.

 

Please note that I have no control over the format of the XML itself...it is
created by a third-party application, and I have to read what's there.

 

Attached is a simple code example that shows what I've tried to do.  Either
I'm doing it wrong or something isn't happening the way it should in the
Digester.  I'd appreciate any help you could offer.

 

Thanks,

Phil

 

 

 

 

Philip A Grim II
Chief Engineer
Data Tactics Corporation
7901 Jones Branch Dr.
Suite 240
McLean, VA  22102

Cell: (717) 880-1714

cid:1257801836.2381.12.camel@dt-pg.dt-pbj.org

The information contained in this message may be privileged and/or
confidential and protected from disclosure.  If the reader of this message
is not the intended recipient or an employee or agent responsible for
delivering this message to the intended recipient, you are hereby notified
that any dissemination, distribution or copying of this communication is
strictly prohibited.  If you have received this communication in error,
please notify the sender immediately by replying to this message and
deleting the material from any computer.



 


Mime
View raw message