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.
Read the image file in binmode; use MIME::Base64 to do the encoding; use,for instance, the XML:OM 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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.