users@jaxb.java.net

Re: how to attach MS word document in xml message?

From: Dmitri Colebatch <colebatchd_at_gmail.com>
Date: Tue, 7 Jun 2005 13:08:27 +1000

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