Hi, Dim,
Thanks for the quick reply. I tried to use the base64Binary type to
hold the ms word document in form of bytes, and it does work. Also
using Any type to hold the ms word document works too. One thing to use
Any is that when you unmarshal any type element, it has to be Object or
String. So setting it to byte[] is not working, but using the Base64
encode it to string will work.
Thanks again.
Harry
-----Original Message-----
From: Dmitri Colebatch [mailto:colebatchd_at_gmail.com]
Sent: Monday, June 06, 2005 11:08 PM
To: users_at_jaxb.dev.java.net
Subject: Re: how to attach MS word document in xml message?
Hi Harry,
The standard approach to binary in xml is to base64 encode it and
place it inside a string type (probably as a cdata, but that doesn't
really matter as long as the encoding is done correctly).
So, something like the following:
InputStream msWordInputStream = ....
String encoded = Base64.encode(msWordInputStream);
foo.setMsWordDocument(encoded);
where foo is your jaxb object. From there you should be able to
marshal it as with any other object I believe.
Having said all this, I'm not sure if JAXB has any magic that does
what you want as I've only just started with it myself (o:
cheers
dim
On 6/7/05, Tang, Harry <Harry.Tang_at_bellsouth.com> wrote:
>
>
> Hi, It seems that there is a way to embed image data files in the xml
> messages. Does anyone know if ms word document can also be embeded as
> element in xml message? I would appreciate if someone can provide a
simple
> example for the schema and JAXB process to encode and extract the file
from
> XML. Message.
>
>
>
> Thanks in advance.
>
>
>
> Harry
>
> *****
>
> "The information transmitted is intended only for the person or entity
to
> which it is addressed and may contain confidential, proprietary,
and/or
> privileged material. Any review, retransmission, dissemination or
other use
> of, or taking of any action in reliance upon this information by
persons or
> entities other than the intended recipient is prohibited. If you
received
> this in error, please contact the sender and delete the material from
all
> computers." 118
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net