Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Help with a simple (I think) Stylesheet

Featured Replies

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

....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 by Guest

  • 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

  • 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

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 by Guest

  • 1 year later...

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

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.