• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

**Retrieve jpeg from XML file.

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a jpeg file stored as binary in xml file. When this XML file is retrieved at client side , it has to be parsed and the jpeg file displayed on the jsp page. Any clue how should I do this.

<root>
<picture> binary of jpeg file </picture>
<pic_ID> picture id </pic_ID>
<root>

Thanks.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is not legal XML to store binary data - XML must be Unicode. To handle binary data (for example in SOAP) it gets encoded - either as hex or base64.
This is of course more bulky but results in legal XML.
The Jakarta Commons project has base64 encoder/decoder classes among many other cool things. Do a Google search for "jakarta commons codec"
Bill
reply
    Bookmark Topic Watch Topic
  • New Topic