October 4, 200718 yr Hi all Can anyone tell me how to do a stylesheet that will replace some text with a carriage return or other character? I have a field that I am exported with representing the returns required. I would like to end up with a text file with the text replaced with a return or ^m ... is this possible. At the moment my style sheet does nothing to format the text file outputted. This is my first attempt at a stylesheet. Any help would be greatly appreciated. Cheers ZP
October 4, 200718 yr ....Me either but try this page. I think you can make it work just looking at it quikly. http://www.xml.com/pub/a/2002/06/05/transforming.html Scroll down to 'search and replace' PS: Post the file or some of the code... Edited October 4, 200718 yr by Guest
October 5, 200718 yr Author Thanks you so much ... that was exactly what I was after. What a great resource, even found the correct code for the carriage return. Below is the code for the StyleSheet to replace **BR** with a carriage return. <?xml version="1.0" encoding="UTF-8"?> "concat(substring-before($outputString,$target), $replacement)"/> select="substring-after($outputString,$target)"/> select="$replacement"/> Thanks again ZP
October 5, 200718 yr Author Two more things Firstly, the carriage return character is It didn't appear in the post as I didn't use the code option ... oops Secondly, a question, why does my output file start with a Zero? Cheers ZP
October 5, 200718 yr Huummmm As I don't deal with this part much do you have a sample file of the pre-xsl html or text being used? Ps even in code the return won't show most times. I just put spaces in between when needed. Edited October 5, 200718 yr by Guest
February 18, 200916 yr It is an old thread, but in case someone needs help removing the leading zero from the text output, the following should do the trick. Insert this code anywhere in the XSL file to remove the zero: The 0 is a value of the tag that is present in the fmpxmlresult output. Cheers, Andreas
Create an account or sign in to comment