Instead of converting to string in XSL and then calling php:function(),
use directly php:functionString() when calling PHP functions which
actually expect a string argument.
Besides possible performance improvements, this is done mainly for
readability.
<xsl:text disable-output-escaping="yes">]]></xsl:text>
</description>
<xsl:if test="$generate-enclosure = 1">
<xsl:text disable-output-escaping="yes">]]></xsl:text>
</description>
<xsl:if test="$generate-enclosure = 1">
- <xsl:copy-of select="php:function('Tweeper::generateEnclosure', string($picture-url))"/>
+ <xsl:copy-of select="php:functionString('Tweeper::generateEnclosure', $picture-url)"/>
</xsl:if>
</item>
</xsl:template>
</xsl:if>
</item>
</xsl:template>
<xsl:text disable-output-escaping="yes">]]></xsl:text>
</description>
<xsl:if test="$generate-enclosure = 1">
<xsl:text disable-output-escaping="yes">]]></xsl:text>
</description>
<xsl:if test="$generate-enclosure = 1">
- <xsl:copy-of select="php:function('Tweeper::generateEnclosure', string($item-content-image))"/>
+ <xsl:copy-of select="php:functionString('Tweeper::generateEnclosure', $item-content-image)"/>
</xsl:if>
</item>
</xsl:template>
</xsl:if>
</item>
</xsl:template>
</xsl:template>
<xsl:template match="a[@data-expanded-url]" mode="enclosure">
</xsl:template>
<xsl:template match="a[@data-expanded-url]" mode="enclosure">
- <xsl:copy-of select="php:function('Tweeper::generateEnclosure', string(./@data-expanded-url))"/>
+ <xsl:copy-of select="php:functionString('Tweeper::generateEnclosure', ./@data-expanded-url)"/>
</xsl:template>
<xsl:template match="div[@data-image-url]" mode="enclosure">
</xsl:template>
<xsl:template match="div[@data-image-url]" mode="enclosure">
- <xsl:copy-of select="php:function('Tweeper::generateEnclosure', string(concat(./@data-image-url, ':orig')))"/>
+ <xsl:copy-of select="php:functionString('Tweeper::generateEnclosure', concat(./@data-image-url, ':orig'))"/>
</xsl:template>
<xsl:variable name="screen-name" select="//div[@class='user-actions btn-group not-following ']/@data-screen-name"/>
</xsl:template>
<xsl:variable name="screen-name" select="//div[@class='user-actions btn-group not-following ']/@data-screen-name"/>
-->
<xsl:variable
name="processed-title"
-->
<xsl:variable
name="processed-title"
- select="php:function('preg_replace', '@((?<!\()(?:http[s]?://|pic.twitter.com))@', ' \1', string($item-content))"/>
+ select="php:functionString('preg_replace', '@((?<!\()(?:http[s]?://|pic.twitter.com))@', ' \1', $item-content)"/>
<!-- Also strip and … -->
<xsl:value-of select="normalize-space(translate($processed-title, ' …', ''))"/>
</title>
<!-- Also strip and … -->
<xsl:value-of select="normalize-space(translate($processed-title, ' …', ''))"/>
</title>