简体   繁体   中英

Xslt 1.0 add string into another string at specified place

I'm new to xslt and I have a little problem. I have an image with a src attribute like this:

src="{imageurl}"

this returns me an image src = "/_layouts/images/icdocx.png" for example. 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". 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:

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,'.'))}"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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