my dog learned polymorphism
The moose likes XML and Related Technologies and the fly likes Embedded document in XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Embedded document in XML" Watch "Embedded document in XML" New topic

Embedded document in XML

Tina Shupe

Joined: Dec 27, 2002
Posts: 7
Is it possible to embed a document into XML? Example… is it possible to take a pdf and embed it into a xml document, and then it can be read back as a pdf document.
We were informed that this is possible?!
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
For binary data, you need to encode it before it can become part of an XML document. Use base64 encoding like SOAP and email attachments but of course it will have to be decoded back to the binary format.
The simplest thing might be to embed a link to the PDF file rather than the bulk file.
Christian Schnepf

Joined: Sep 25, 2001
Posts: 28
Is there any recommendations on which base64 encoding api to use to do this with?
I agree. Here's the link:
subject: Embedded document in XML
jQuery in Action, 3rd edition