<img height="75" width="100">
<xsl:attribute name="src">
<xsl:value-of select="concat('data:JPG;base64,',/Xpath)"/>
</xsl:attribute>
</img>
图像是根据XML中的值创建的。 我使用上面的代码使用xml中的xslt创建了一个图像,但是如何让它可以下载?
答案 0 :(得分:0)
您可以创建指向内嵌图像的链接(例如使用javascript):
<a target="_blank" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAALFElEQVRogc2Zf2xU15XHP/fNm5k387DHM4PBptS2CpSG4BihTQiwJI6SsptQFHkVRVF+qF1FaVItu4p227KgbNJWq60qdbVdtJGqVNuIKItIpLpIJKXpqpS0oDaQGAgQb1xwMPbY1PhnZuz58d680z/G8zI/7bHhjz3S0Zx5c+/3nnvu951z3hvlOI5QIkopAEQEpRQiZUP+34ied3Y+qWVMoUxPT/P2229z9uxZEokETU1NdHZ2smPHDjRNW6qvlcVxHBERcRxH8nZeCn8rHVPJtixLXnrpJVm2bJkARerxeKS9vV1OnDhRFadwrVpt8gClWgheqz799NNljud127ZtsmXLFvH5fPLaa68tGruaVt3AYvX999+v6jwgmzZtkra2NvF6vRIIBOTKlSu3bgO3gkIvvPDCvBso1WeffbYmWi5kI7dIurq6XK5rmlbmsGmaYhiG+z0cDotlWTe9ri63KEVOTExgGAYdHR2k02l6e3tJp9NEo1F2796NiNDX18eZM2ewbZvJyUkuXLjApk2bbm7hW0Whbdu2yd69e2VwcFCOHTsmuq4LIEePHpWxsTEZGxuTV155peh0Dh06dNMU0oCiQiUiZd8rjSm1vV4v0WiUrq4uwuEwa9euZc2aNdx///3ccccd7Nmzh6eeeopoNOrOLawvC+FXszWlFJW0cJFa1DRNYrEYAwMDnDn1Czpv/xP3t19npP/3DA8Pc/jwYUZGRjAMw8U2TbNm/Gqqy1y7kN9VpaorJS1FJTsUCpFOp/nqrjY6I9/juW/5mBxXmBM7+dHzENcfYHpqgqGhIRd3eHh4XsxabL3a0RRuqpajDIfD/Onsj/n+d4VQGPCEWL5yCtD5h6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