I am trying to have a single xml and at most one xsl stylesheet, the contents of the xml file are like below
<catalogue>
<item>
<item_id>1234</item_id>
<item_desc>hi-fi sanio</item_desc>
<price>12.50</price>
<image>iVBORw0KGgoAAAANSUhEUgAAANIAAAAzCAYAAADigVZlAAA</image>
</item>
<item>
<item_id>4614</item_id>
<item_desc>lace work</item_desc>
<price>1.50</price>
<image>QN0lEQVR4nO2dCXQTxxnHl0LT5jVteHlN+5q+JCKBJITLmHIfKzBHHCCYBAiEw</image>
</item>
<item>
<item_id>614</item_id>
<item_desc>bicycle</item_desc>
<price>150</price>
<image>jVteHlN+5q+JCKBJITLmHIfKzBHHCCYBAiEwlEQVR4nO2dCXQTxxnHl0L</image>
</item>
</catalogue>
The purpose is to be able to share the xml file with end users so that they can view it using their web browser (IE11 for now).
I'm using python and lxml to create the xml file I have encoded the image of the items using base64 encoding and added an image node to each item. I really want to embed the images directly in the xml so when an end user opens it up everything renders in their browser. i.e no hyper-links
I am at a loss as to how to get end-user browsers to decode the image node. They won't have any application whatsoever to decode so everything must be either in the xml or in an associated stylesheet using the browser.
Does anyone know if it is at all possible to use the xsl to decode the image embedded in the xml document? Any examples that I can look at to see how it would be done.
Generally what are good ways to encode and then decode (embed) images (png/jpg) using only xml alone or in conjunction with xsl?
Regards
data:
URIs? – Martin Honnendata:
URIs for images. I think your comment should be an answer, so this question can (potentially) be marked as answered. – LarsH