Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Help with a simple (I think) Stylesheet


This topic is 5755 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

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

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

Posted

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

Posted (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 by Guest
  • 1 year later...
Posted

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

This topic is 5755 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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