简体   繁体   English

Xslt 1.0将字符串添加到指定位置的另一个字符串中

[英]Xslt 1.0 add string into another string at specified place

I'm new to xslt and I have a little problem. 我是xslt的新手,我有一个小问题。 I have an image with a src attribute like this: 我有一个带有src属性的图像,如下所示:

src="{imageurl}"

this returns me an image src = "/_layouts/images/icdocx.png" for example. 例如,这会给我返回图像src =“ /_layouts/images/icdocx.png”。 What I need to do is to put "_big" just before the ".", so I need xslt to return my src attribute like "/_layouts/images/icdocx_big.png". 我需要做的是将“ _big”放在“。”之前,因此我需要xslt返回src属性,例如“ /_layouts/images/icdocx_big.png”。 I've tried to it like this: 我已经尝试过这样:

src="concat(substring-before({imageurl},'.'),'_big',substring-after({imageurl},'.'))"

but it didn't work. 但这没用。 Can somebody help me? 有人可以帮我吗? Thanks. 谢谢。

In this case you have to put the curly bracket {..} around the concat() Try this: 在这种情况下,必须将大括号{..}放在concat()周围,​​请尝试以下操作:

src="{concat(substring-before(imageurl,'.'),'_big',substring-after(imageurl,'.'))}"

But than there is one dot missing, therefore this should do: 但是,比起缺少一个点,这应该可以做到:

src="{concat(substring-before(imageurl,'.'),'_big','.', substring-after(imageurl,'.'))}"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM