我正在尝试将所有 http:// 实例从href标记和图像来源替换为 https://
<xsl:for-each select="item[position()<2 and position()> 0]"><!-- display 1 - skip none -->
<article class="395by265-Presentation">
<a href="{link}" target="_blank">
<img src="" width="395" height="265" alt="{title}" border="0" class="FBAPP"><xsl:attribute name="src">
<xsl:value-of disable-output-escaping="yes" select="enclosure/@url"/></xsl:attribute>
</img>
<div class="synopsis"><xsl:value-of select="description"/></div>
</a>
</article>
</xsl:for-each>
任何帮助表示感谢。
我正在使用XSLT 1.0。
尝试访问和替换HTTP的所有实例。
答案 0 :(得分:1)
您使用的是哪个版本的XSLT?
XSLT 2.0支持replace function:
replace(string,pattern,replace)
返回通过用replace参数替换给定模式而创建的字符串。
Example: replace("Bella Italia", "l", "*")
Result: 'Be**a Ita*ia'
Example: replace("Bella Italia", "l", "")
Result: 'Bea Itaia'
Example syntax: <xsl:value-of select="string:replace('Bella Italia','l','')" />
Result: 'Bea Itaia'
在这里查看:https://stackoverflow.com/a/3067130/1846192用于XSLT 1.0解决方案。