Hello, I'm a new JiBX user and have been through the full tutorial and have some simple bindings up and running. I am evaluating JiBX (along with StAX) as a replacement for JDOM for serializing fairly large sets (thousands of elements) of data that have lots of nested collections (lists and maps, I know the issues and approaches with maps in JiBX already). Given this background, I have two questions: 1) When using JDOM we found good speedups by adding the count of elements in our xml so that when deserializing we could create the collection with the proper capacity once, rather than having it automatically grow in the background. This gives XML like:
<DataList count="5234">
 <DataElement attribFoo="blah" attribBar="gibble"/>
 <DataElement attribFoo="fred" attribBar="barney"/>
   ...
 <DataElement attribFoo="mip" attribBar="pirney"/>
</DataList>

How would I go about using the value of the count attribute to set the initial capacity of a collection using JiBX? I see from the collection element docs that there is a size-element used to query the size, and also a load-method, although from the docs I am not totally clear on what the load-method does, it does not see to do what I wish.

2) Is there a recommended best-practices way to handle hierarchies of collections in JiBX? I've found a few mentions in searching the mailing lists but haven't found anything definitive or really to my liking. The issues here are two-fold: how to handle mappings in a modular fashion (my plan is to use the include element) and also how to handle the binding factory. For the factory, should I just specify the class at the top of the hierarchy? Would this allow me to create subsets (export just some sublists) with something else as the root element?

Thanks in advance for any tips/advice,
Chris


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to