I have used <xsl:value-of select="translate($var,'|',' | ')"/>
where var is in format of ABCD|EFGH|AWED|WERS|GGHS|KLIY|GYOK . The out put i am getting is : ABCD EFGH AWED WERS GGHS KLIY GYOK. i.e. all the pipes are lost. What is the reason for this... ?
Asked
Active
Viewed 93 times
1 Answers
2
Translate replaces the first character from the first string with the first character from the second string, the 2nd from 1st with 2nd from 2nd and so on. So here pipe is being replaced with space, and the next 2 characters of the second string are ignored.
In XSLT 2.0 there's a replace function. However in XSLT 1.0 there isn't, so you have to use a workaround. See here for a solution: XSLT string replace

Community
- 1
- 1

JohnLBevan
- 22,735
- 13
- 96
- 178
-
Any option in XSLT 1.0 ? – apratik Sep 03 '13 at 13:04
-
Yes - click the above link to `XSLT string replace`; that points to another StackOverflow question/answer for exactly that question. – JohnLBevan Sep 03 '13 at 13:50