Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Embedded document in XML  RSS feed

 
Tina Shupe
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Bill
 
Christian Schnepf
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any recommendations on which base64 encoding api to use to do this with?
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!