473,323 Members | 1,560 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

XSL Replace multiple strings

Hello,

I don't know well XML and I can't figure out how to solve this problem ..

I need to replace some strings inside a text using XSL and inside a for-each
statement (the list of strings to replace).

I've tried to use the common replace functions we can find usually on forums
or websites but it outputs several times the same text with every string
replaced.

ex:
....
<text> This is the text to modify ! </text>
....

I would like to replace for example 'This' by '<b>This</b>' , 'text' by
'<b>text</b>' etc...

for the moment I have :

<b>This</b> is the text to modify ! This is the <b>text</b> to modify !
etc...

I would like :

<b>This</b> is the <b>text</b> to modify !

Any idea ?
Thanks
Jul 20 '05 #1
1 10092
I've found a solution ...

http://www.dpawson.co.uk/xsl/sect2/r...html#d7975e115

I've used the "Search and replace acronyms" section to modify my templates.

Now it works fine :)
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Xah Lee | last post by:
suppose you want to do find & replace of string of all files in a directory. here's the code: ©# -*- coding: utf-8 -*- ©# Python © ©import os,sys © ©mydir= '/Users/t/web'
8
by: skinnybloke | last post by:
Hi - I am a newbie to Access & SQL and I would appreciate some help on this if at all possible. I have a query that contains the following code. SELECT DISTINCT Product. AS , Product. AS ; ...
3
by: Craig Buchanan | last post by:
Is there a way to combine these two Replace into a single line? Regex.Replace(Subject, "\&", "&amp;") Regex.Replace(Subject, "\'", "&apos;") Perhaps Regex.Replace(Subject, "{\&|\'}", "{&amp;|&apos;}")...
3
by: teo | last post by:
I have a text. Inside the text the "hallo" word occurs five time. I need to replace "hallo" with "hallo world". Unfortunately I get this: hallo world world world world world
2
by: rengask | last post by:
I got the code to find and replace within an open text file. ------------------ Private Sub cmdFile_Click() Dim strTemp As String txtFile = "" dlg.FileName = "*.*" dlg.ShowOpen ...
5
by: V S Rawat | last post by:
I was trying to use back-to-back replace functions to convert a url: str1 = str.replace("%2F","/").replace("%3F","?").replace("%3D","=").replace("%2 6","&"); It didn't replace all 4 types of...
5
by: neeludhiman | last post by:
Hi All, Can someone please help me with the code in C / C++ to find a string in an input text file and replace it with another string in output text file. The catch is that white spaces in the...
4
nev
by: nev | last post by:
I would like to know if there is a faster way of doing this. str = "(0918)346-5303" strings.replace(str,"(","") strings.replace(str,")","") strings.replace(str,"-","") after that str will...
5
by: buu | last post by:
I have an function that replaces some string from a huge text that I run very often... So, I wanted to speed it up... I was using String and StringBuilder. But, I was wandering should same...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.