The only way I can think of right now is to either do a multi-pass of
the XML (once for each unique userid) , or to load all objects into
memory and process them. The first is more memory efficient but slower.
From: madhu rao [mailto:rollma...@gmail.com]
Sent: Wednesday, August 19, 2009 9:07 AM
To: JiBX users
Subject: Re: [jibx-users] Parsing huge xml files using jibx
Thanks a lot Bob for your inputs. Here is the sample structure of how
the xml
<dataset>
<user>
<userid>1001</userid>
<firstname>XXXX</firstname>
</user>
<user>
<userid>1002</userid>
<firstname>XXXX</firstname>
</user>
<user>
<userid>1003</userid>
<firstname>XXXX</firstname>
</user>
<useraddress>
<userid>1001</userid>
<street>XXXX</street>
<city>XXXX</city>
<country>XXXX</country>
</useraddress>
<useraddress>
<userid>1002</userid>
<street>XXXX</street>
<city>XXXX</city>
<country>XXXX</country>
</useraddress>
<useraddress>
<userid>1003</userid>
<street>XXXX</street>
<city>XXXX</city>
<country>XXXX</country>
</useraddress>
</dataset>
I was looking at getting all the details of user id 1001 and process it
and then continue with userid 1002. Is this kind of operation possible
with jibx ?
Thanks
Madhu
On Mon, Aug 17, 2009 at 8:04 PM, Bob Reynolds
<bob.reyno...@healthlanguage.com> wrote:
For our project, we are not building the entire object graph in memory -
rather the objects are consumed an processed while JiBX unmarshalls the
XML. To achieve this, we use the store-method and iter-method of the
collection element in our config file (names changed to protect i.p.):
Configuration file:
<mapping name="BIG_XML" class="com.myproject.ObjectUpdates">
<collection field="_objectStream" store-method="add"
iter-method="iterator">
<structure name="MYELEMENT"
type="com.myproject.MyElement" choice="true" ordered="false">
...
class ObjectUpdates {
private ObjectStream _objectStream;
}
class ObjectStream {
public void add(int position, Object object) {
// process here but don't store in
memory
}
public Iterator iterator () {
// construct iterator here...
}
}
From: madhu rao [mailto:rollma...@gmail.com]
Sent: Saturday, August 15, 2009 8:27 AM
To: jibx-users@lists.sourceforge.net
Subject: [jibx-users] Parsing huge xml files using jibx
Hi All,
We are implementing a project in which we have a requirement of parsing
a huge xml file around 26MB. We decided to go with jibx to do this. So I
am bit concerned about the memory consumption of this operation. Here i
am looking forward for some suggestions as to how to reduce the memory
footprint of xml parsing
Thanks
Madhu
________________________________
NOTICE BY HEALTH LANGUAGE, INC.
This message, as well as any attached document, contains information
from Health Language, Inc. that is confidential. The information is
intended only for the use of the addressee named above. If you are not
the intended recipient, you are hereby notified that any disclosure,
copying, distribution or the taking of any action in reliance on the
contents of this message or its attachments is strictly prohibited, and
may be unlawful. If you have received this message in error, please
delete all electronic copies of this message and its attachments, if
any, destroy any hard copies you may have created, without disclosing
the contents, and notify the sender immediately. Unless expressly stated
otherwise, nothing contained in this message should be construed as a
digital or electronic signature, nor is it intended to reflect an
intention to make an agreement by electronic means.
------------------------------------------------------------------------
------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008
30-Day
trial. Simplify your report design, integration and deployment - and
focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users
----
NOTICE BY HEALTH LANGUAGE, INC.
This message, as well as any attached document, contains information from
Health Language, Inc. that is confidential. The information is intended only
for the use of the addressee named above. If you are not the intended
recipient, you are hereby notified that any disclosure, copying, distribution
or the taking of any action in reliance on the contents of this message or its
attachments is strictly prohibited, and may be unlawful. If you have received
this message in error, please delete all electronic copies of this message and
its attachments, if any, destroy any hard copies you may have created, without
disclosing the contents, and notify the sender immediately. Unless expressly
stated otherwise, nothing contained in this message should be construed as a
digital or electronic signature, nor is it intended to reflect an intention to
make an agreement by electronic means.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users