File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
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: 13027
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
It's not a secret anymore!