我有一个XML格式的URL,我正在尝试通过XSLv.1传递。xml在以'?‘开头的url后面包含随机数。
<Pictures>
<url>http://photos.somewhere.cm/82873604/photos/1.jpg?20161010170035</url>
<url>http://photos.somehwere.cm/82873604/photos/2.jpg?20161010170035</url>
<Pictures>目前,我的xsl如下所示
<attachments>
<xsl:for-each select="Pictures/url">
<image>
<xsl:value-of select="url" />
</image>
</xsl:for-each>
</attachments>如何删除'?‘后面的所有文本?并且只与url一起保留。
<attachments>
<image>http://photos.somewhere.cm/82873604/photos/1.jpg?</image>
<image>http://photos.somehwere.cm/82873604/photos/2.jpg?</image>
<attachments>提前感谢您的帮助。
赛迪亚。
发布于 2016-12-11 03:28:42
我想通了:
<attachments>
<xsl:for-each select="Pictures/url">
<image><xsl:value-of select="substring-before(node(),'?')"/></image>
</xsl:for-each>
</attachments>感谢您的提示@M. Honnen
https://stackoverflow.com/questions/41079120
复制相似问题