How to embed images in to xml file?
-
Hi friends, I am newbie to xml, i am writing xml file using xmlTextWriter Class of System.Xml namespace. i am able to write the contents in to an xml file but the problem here is that i want to embed images in to xml file. right now i am using <img src="path"/> but this will give u the link but i want to embed images directly in to xml file Please share ur ideas Thanks in advance
-
Hi friends, I am newbie to xml, i am writing xml file using xmlTextWriter Class of System.Xml namespace. i am able to write the contents in to an xml file but the problem here is that i want to embed images in to xml file. right now i am using <img src="path"/> but this will give u the link but i want to embed images directly in to xml file Please share ur ideas Thanks in advance
-
You can Base64 encode the image and put the encoded string between the tags:
Encoded string
Be aware that Base64 encoding causes an increment of the file size of about 33%, so you should only embed small images inside the XML.
-
hi me too having the same problem and tried converting the image to base64. But still the image didn't displayed in the final Output. I want display an image in xml Spreadsheet.any suggestions? Thanks in advance.
-
What is your problem? What language are you using? In C# it's simple to convert a
byte[]
to a base64 string:string result = System.Convert.ToBase64String(source);
Then you can assign the string to the
InnerText
property of yourXmlElement
. -
Actually i want to display an image in XML spreadsheet. Will this work in XML spreadsheet?