Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

embedding image in XML file

Status
Not open for further replies.

dipti1

Programmer
Jul 25, 2006
9
US
Hi,

I am in need to embed image into XML file so that when somebody else uses the XML file, the image is still there. Is there any way to do this? Is it possible? Please give me some suggestions if you know about.

Thanks a lot.
 
Read the image file in binmode; use MIME::Base64 to do the encoding; use,for instance, the XML::DOM to do the xml side; put the encoded string to a node. (I am not convinced I need to spend more time on this as far as I see the history.)
 
If you want the xml file to display the image then you need to apply an xml-stylesheet (xsl).
If you need the xml file to contain the image, then tsuji is right, you need to encode the image bytes into base64, the result is a string that you can embed in your xml file.

I'm sure there are applications that encode files into base64, but I don't know none, we use our own java app to do this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top