Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

xslt translate() function....help please

I am gonna rephrase my question again as nobody answered it the last time :(
although it should be pretty straightforward for some of you xml gurus :p

I have an xml document that i am converting into an html document using XSLT. for e.g
<?xml version="1.0" encoding="UTF-8" ?>
<?xml:stylesheet href="styles.xsl" type="text/xsl" ?>
<ParentTag>
<childTag1>
1 first line
2 second line
3 third line
</childTag1>
<childTag2>
not of our concern.
</childTag2>
</ParentTag>

Now what I want to do is to use the translate function provided by xslt on the value/text of childTag1 only. In such a way that every word: 'line' is replaced with 'one'.

the syntax of translate is:
translate(string, replaced_text, replacement_text)
so I need to get my tags value in the variable string which is:

1 first line
2 second line
3 third line

but the problem is XSLT syntax is so bad that i just cant devote enough time to learn it. Any suggestions for the syntax guys?? an example or a reference would be extremely useful.

cheers :)
[1303 byte] By [alinaqvi90] at [2007-11-11 10:02:47]