Zippy Aus Posted April 20, 2005 Posted April 20, 2005 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
Martin Brändle Posted April 20, 2005 Posted April 20, 2005 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.
Zippy Aus Posted April 21, 2005 Author Posted April 21, 2005 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
Martin Brändle Posted April 21, 2005 Posted April 21, 2005 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.
Zippy Aus Posted April 22, 2005 Author Posted April 22, 2005 Once again. Thanks Martin. I have my pages working perfectly. Regards S
QuinTech Posted April 26, 2005 Posted April 26, 2005 Any ideas how to do this with FM v6? I tried what you prescribed above, but I get the error The specified funciton is not available: "]xalan://com.fmi.xslt.ExtensionFunctions:break_encode J
Martin Brändle Posted April 27, 2005 Posted April 27, 2005 The fmxslt extension functions are available in FMS7A only. If you need to encode your line breaks with FM6, you should follow along this receipt.
QuinTech Posted April 27, 2005 Posted April 27, 2005 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
Martin Brändle Posted April 27, 2005 Posted April 27, 2005 Something like this hex-decimal/decimal-hex calculator ? Just type in A , hex --> dez yields 10 Type in 13 , dez --> hex yields D & x D ; = & # 1 3 ; & # 10 ; = & x A ; See also these charts of Unicode values if you need some special characters.
QuinTech Posted April 28, 2005 Posted April 28, 2005 Martin, that Unicode reference is great! I guess I will have to trap for xA and xD, as it seems a line break could be either one of those. J
QuinTech Posted June 1, 2005 Posted June 1, 2005 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!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now