Hi, Does anyone have a sample code or reference links on how to send and read binary data in xml. I mean instead of attachment, you can attach files in binary format in xml using base64 to hexadecimal, I cann't use Saaj or axis so I need to put the attachment in xml. Any links or samples would be appreciated.
Yes, binary data must be encoded, typically as base64. Recall that XML has to be Unicode text - there are many binary values that are not valid Unicode characters and will cause a XML parser error. Bill
Dharamvir (DV) Punia
Joined: Oct 04, 2004
Hi William, I don't have to worry about encoding here, all I have to worry about is decoding.
This is the scenario: I will receive a post request on a servlet which will have the xml data with binary , so I have to parse the xml document and the node elements, and one of node elements would be binary attachment. What Can I use to decode it, wouldn't Balaji's approach work in this case. If you can, Can you post some links to reference sites or sampes on how to decode it using base64 or anyother way, It doesn't matter what apprach I use, all I care about is getting the binary data. Thanks, -DV
Author and all-around good cowpoke