问题
Is there a way to store image data in XMl (XSD)?
回答1:
You could encode it using Base64 and store the result.
回答2:
I really don't recommend to do this but if you really have to you can just encode your image in Base64 and save it to the XML File and decode it where you want to use it.
I have seen this in some Software projects but if there is a way to avoid this please don't do it! That's not what XML is made for.
回答3:
You could base64 encode it (xsd:base64binary).
回答4:
Of course there is a way. Although if you are talking about bitmaps (not vector-based images) it would make no sense at all.
来源:https://stackoverflow.com/questions/5232445/storing-image-in-xml