【问题标题】:Can XSL use only PHP function that returns a string?XSL 可以只使用返回字符串的 PHP 函数吗?
【发布时间】:2011-09-25 00:56:53
【问题描述】:

为什么这不起作用? XSL 可以只使用返回字符串的 PHP 函数吗?

  <xsl:if test="string-length(substring-before(TipoImm, '/')) &gt; 0">
    <xsl:element name="test">
      <xsl:value-of select="php:functionString('implode',
            (php:function('explode', TipoImm, '/')), '-')" />
    </xsl:element>
  </xsl:if>

【问题讨论】:

  • 问题是您试图将 PHP 函数调用传递给 implode,而它需要 XPath 表达式吗?

标签: php arrays function xslt php-extension


【解决方案1】:

不,您还可以返回 DOMDocument 或基本上任何 DOMNode 派生类。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-02-03
    • 1970-01-01
    • 1970-01-01
    • 2011-02-07
    • 2018-09-18
    • 1970-01-01
    • 2010-11-23
    相关资源
    最近更新 更多