Jump to content

XSL and Ampersand


Ians

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

Recommended Posts

Hello all,

 

I'm grafting an XSL to generate text in Final Cut Pro 7, it works fine except I need the carriage return "
"

 

Like so

 

<value>Client:&#13;Agency:&#13;Product:&#13;Clock Number:&#13;Title:&#13;Duration:&#13;Aspect:&#13;Audio Type:&#13;Language:</value>

 

Trouble is that the result is: "&amp #13;"

 

I've read in Filemakers "Developing FileMaker XSLT stylesheets" PDF (Page 69) that I need to use the function: fmxslt:break_encode(String value)

and to disable-output-escaping attribute of the <xsl:value-of> and <xsl:text> elements set to “yes” (disable-output-escaping="yes").

 

Could someone please explain to me with an example of how I could formulate this.

 

Regards

Ian

Link to comment
Share on other sites

I am not sure I understand the context here. Is this part of your XSLT stylesheet?

<value>Client:&#13;Agency:&#13;Product:&#13;Clock Number:&#13;Title:&#13;Duration:&#13;Aspect:&#13;Audio Type:&#13;Language:</value>

And you are using this to export your records from Filemaker Pro?

 

 

If yes to both, what is the actual output you are hoping to get out of this?

Link to comment
Share on other sites

It's yes to both

 

This will/does generate a text slate in a FCP timeline at the moment it returns: "A CompanyA AgencyA ProductA Clock Number" instead of:

 

A Company

A Agency

A Product

A Clock Number

 

Because the resulting XML has "&amp #13;" instead of "&#13;". Hence I need to I need to use the function: fmxslt:break_encode(String value)

 

 

 

Link to comment
Share on other sites

What is the  output method of your stylesheet (if it's not too big, why don't you just post the whole of it).

 

BTW, there is no fmxslt:break_encode() function in this (exporting) environment. The fmxslt extension functions are only available in CWP.

 

 

---

Ahm, one more thing: why do you expect:

 

A Company

A Agency

A Product

A Clock Number ...

 

and so on, when your code says

 

Client

Agency

Product ...

 

Those are literal text strings, not field values.

Link to comment
Share on other sites

This is my Calc field in FMP

Client & "&#13;" & Agency

This is my XSL:

<name>Text</name>
<effectid>Text</effectid>
<effectcategory>Text</effectcategory>
<effecttype>generator</effecttype>
<mediatype>video</mediatype>
<parameter>
<parameterid>str</parameterid>
<name>Text</name>
<value>
<xsl:for-each select="fmp:COL[1]">
<xsl:value-of select="fmp:DATA"/>
</xsl:for-each>
</value>
</parameter>
<parameter>

This is the result XML:

<effectcategory>Text</effectcategory>
<effecttype>generator</effecttype>
<mediatype>video</mediatype>
<parameter>
<parameterid>str</parameterid>
<name>Text</name>
<value>Swiss Tourism&amp;#13;Online Video 46 AG</value>
</parameter>
<parameter>

This is what it should look like:

<effectcategory>Text</effectcategory>
<effecttype>generator</effecttype>
<mediatype>video</mediatype>
<parameter>
<parameterid>str</parameterid>
<name>Text</name>
<value>Swiss Tourism&#13;Online Video 46 AG</value>
</parameter>
<parameter>
Link to comment
Share on other sites

Instead of:

<value>
<xsl:for-each select="fmp:COL[1]">
<xsl:value-of select="fmp:DATA"/>
</xsl:for-each>
</value>

use:

<value>
   <xsl:value-of select="fmp:COL[1]/fmp:DATA" disable-output-escaping="yes"/>
</value>

BTW, you don't need the calculation field for this. You can achieve the same result by:

<value>
   <xsl:value-of select="fmp:COL[1]/fmp:DATA"/>
   <xsl:text disable-output-escaping="yes">&amp;#13;</xsl:text>
   <xsl:value-of select="fmp:COL[2]/fmp:DATA"/>
</value>

where COL[1] is Client and COL[2] is Agency.

Link to comment
Share on other sites

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