I think mapping for the bar element might be abstract (abstract="true").
Remove the abstract="true" type-name="someName" elements, and add name="foo",
also modify the reference and try your code.
You should be able to marshal the foo instance.
Thanks,
Vikas Jadhav
________________________________
From: Todd Bittner <toddbitt...@gmail.com>
To: jibx-users@lists.sourceforge.net
Sent: Monday, October 3, 2011 9:43 PM
Subject: [jibx-users] Marshalling large collections
I'm not sure if what I'm asking is possible without a custom Marshaller, but I
thought I'd ask in case I missed something in the documentation.
I've got an xml document that looks something like this:
<foo>
<bar .../>
<bar .../>
....
</foo>
where foo is the root element, and the document contains several (possibly on
the order of thousands) of bars.
I'm receiving the Java objects that will be mapped to bar from another source
across the wire, so it's possible that they'll trickle in over time.
I can marshal the Foo element without issue, but, when using the standard
MarshallingContext methods, that involves constructing an entire Bar collection.
What I'd like to do is write out the root element (if need b,e this can be at
the lower level with something like an IXMLWriter, and calls to the context's
startDocument() and endDocument() method) and then marshal the bar elements as
they arrive. It'd be ideal to it in this fashion:
IBindingFactory barFact = BindingDirectory.getFactory(Bar.class);
IMarshallingContext barCtxt = barFact.createMarshallingContext();
...
barCtxt.marshalDocument(barInstance)
so I can marshall the Bar instances on a piecemeal basis.
It appears, though, that binding.xml file doesn't define a mapping for Bar,
only Foo as the root element, so when I attempt to run the
BindingDirectory.getFactory(Bar.class) code, I get an error that the binding
isn't available.
Is there a way I can marshal the Bar element without having to manually make
changes to the binding.xml document or without writing a custom marshaller?
My goal is to take the source schema and the customized schema-set.xml (or some
other customization file), generate the appropriate POJOs, and write the
appropriate XML so that my code has to know as little about the schema as
possible.
Thanks,
Todd
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users