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

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

Recommended Posts

Posted

Hi all

I have almost successfully moved my CDML pages to XSL, but I am still unable to get paragraph breaks in my fields. Do I have to use a substitute calculation or can I do it directly in the XSL page.

Any clues would be greatly appreciated.

TIA

Stephen

Posted

There is a fmxslt extension function for this described on page 64 of the FMS7A Custom Web Publishing Guide.

Try:

<xsl:value-of select="fmxslt:break_encode(XPath_to_your_field)" disable-output-escaping="yes"/>

e.g. where you have

<xsl:value-of select="XPath_to_your_field"/>, wrap the fmxslt:break_encode() function around it and add the attribute disable-output-escaping="yes"

In addition, you should add as namespace definition

xmlns:fmxslt="xalan://com.fmi.xslt.ExtensionFunctions"

to your <xsl:stylesheet ...> tag at the very top of your page, if not already done so.

Posted

Thanks Martin

That was exactly what I needed. One other quick one ... if I have used quotes ie. ' or " in the text field, they are appearing as ? (question marks) ... how can I avoid this?

Thanks again for your assistance. It is greatly appreciated.

Stephen

Posted

Do you use "smart" quotes in the field? (That's some FM setting in document preferences).

Maybe you try to following:

Change your first line in the XSLT file to

<?xml version="1.0" encoding="UTF-8"?>

and

<xsl:output ...> to <xsl:output method="html" encoding="UTF-8"/>

and remove the

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> tag.

The transformation of the stylesheet then produces Unicode-8 format, a format that modern browsers should be able to interpret. Then these smart quotes that are not part of the ASCII char set should be output as Unicode chars. At least I hope so, if I have understood the disable-output-escaping="yes" attribute correctly.

Posted

Once again, thanks a ton, Martin. This works exactly as wanted.

I had tried to do a more complicated version of this very technique, but it failed because I was using & # 1 3 ; instead of & # x A ; . Substituting the new hex code for my original one, the function I wrote works. Do you know of a list of preferred XML hex codes? I had gotten & # 1 3 ; from what I believe to be a good source for HTML codes.

J

  • 1 month later...
Posted

I know this doesn't happen, but this seems to have broken all on its own. The issue I am having is apparently [space] is getting confused with & # x A ; somehow.

When I view the XSLT in a text editor, I have the text & # x A ; in the appropriate place; but when I view it in my chosen XML editor (XMLShell), it changes to a carriage return (the line actually feeds immediately before where I would expect to see & # x A ;). And then when I import into FileMaker using this XSLT, I find that the string I intended to substitute for & # x A ; is being substituted for [space], but not for the newline, which is (of course) what I want.

I'm guessing there is some argument I need to use to avoid this, but I don't know where. Odd thing is, it was working until recently, and I'm sure that I didn't change anything!

This topic is 7113 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.