Scott,
Scott Purcell wrote:
> Hello,
>
> I have created a XSD document with many complex types, and have used the
> XML Code generator (SourceGeneratorMain) to create java binding files.
> This is all good and works well.
Hmm ... let me try to understand one thing here. When you have used the
XML code generator, you have turned off creastion of descriptor classes
and turned on creation of a mapping file, correct ? If that's the case,
why ? It should be the other way around. See below .....
Please note, that a binding file is something completely different.
The term 'binding file' is used in the context of code generation to
overcome naming collisions.
>
> Now, I need to somehow (this is where my question lies) "instantiate" the
> binding files, populate them, and then marshal the objects to XML. I am
> not sure how this is accomplished? Could someone give me some insight as
> to how this works?
>
> My workflow will be like so:
> Once the binding files are created (which they are) I have the need to
> instantiate the objects, populate them with different data and then
> marshall the data to xml.
Assuming that you have generated source code (including descriptor
classes, that is) from your XML schema, here's what you have to do to
marshal an object instance to XML.
<code>
XMLContext context = new XMLContext();
Marsdaller marshaller = context.createMarshaller();
YourObject yourObject = .... ;
marshaller.marshal(yourObject);
</code>
If (and only if) you have the descriptor classes on your classpath,
Castor will just marshal XML according to your definitions in your XMl
schema.
Does this make sense ?
Werner
>
> Thanks,
> Scott
>
>
>
>
>
> CONFIDENTIALITY NOTICE
> This e-mail message and any attachments are only for the use of the intended
> recipient and may contain information that is privileged, confidential or
> exempt from disclosure under applicable law. If you are not the intended
> recipient, any disclosure, distribution or other use of this e-mail message
> or attachments is prohibited. If you have received this e-mail message in
> error, please delete and notify the sender immediately. Thank you.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email