如何在 XSLT 的帮助下对 XML 文件中的图像进行编码 [英] How to encode a image in XML file with help of XSLT

查看:31
本文介绍了如何在 XSLT 的帮助下对 XML 文件中的图像进行编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过 XML 文件发送图像 (.JPG).如何在 XSLT 文件的帮助下对 XML 文件中的图像数据进行编码,以便用户可以在 Outlook 中看到图像?图像不在共享文件夹位置;它在我的个人文件夹中,但用户应该能够看到图像.

I want to send an image (.JPG) through an XML file. How can I encode the image data in the XML file with help of XSLT file so that a user can see the image in Outlook? The image is not in a shared folder location; it is in my personal folder but the user should able to see image.

我已经找到了解决问题的三种方法:

I have worked out and I got three ways to solve the problem:

  1. CDATA
  2. BASE64
  3. 只需在 XML 中创建对图像的 URL 引用

我在 CDATA 和 BASE64 上工作,但图像没有出现在用户的 Outlook 上.所以请帮我弄清楚如何获取图像.如何用 XML 或 XSLT 编写代码以便我可以查看图像?可能吗?

I worked on CDATA and BASE64 but image is not coming out on the user's Outlook. So please help me work out how to get the image. How can I write code in XML or XSLT so that I can view the image? Is it possible?

推荐答案

你也可以试试(使用 base64):

You could also try (using base64):

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA..." />

更多自定义使用 CSS(设置高度和宽度 appr):

in more custom using CSS (set height and width appr):

div.image {
  background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA...);
}

来源

这篇关于如何在 XSLT 的帮助下对 XML 文件中的图像进行编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆