Zippy Aus Posted October 4, 2007 Posted October 4, 2007 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
Cabinetman Posted October 4, 2007 Posted October 4, 2007 (edited) ....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, 2007 by Guest
Zippy Aus Posted October 5, 2007 Author Posted October 5, 2007 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
Zippy Aus Posted October 5, 2007 Author Posted October 5, 2007 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
Cabinetman Posted October 5, 2007 Posted October 5, 2007 (edited) 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, 2007 by Guest
Andreas T. Posted February 18, 2009 Posted February 18, 2009 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
Recommended Posts
This topic is 6096 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now