0

我正在编写一个程序来从 xsl 调用 php,但我需要存储一个 xsl 变量,以便我可以将它发送到 php 函数 php:functionString()

<xsl:template match="atom:entry">

 <xsl:if test="position() &lt;= 10">
   <table border="0" width="55"  cellpadding="2" cellspacing="4" style="float:left;">
      <tr >
         <td width="55">

    <a href="?page_id=9#anchor-{ atom:id }" >
    <img id="icon">
<xsl:attribute name="src">

<xsl:value-of select="./im:image[1]"/>

</xsl:attribute>
</img></a>
</td>
</tr>

         <tr> <td width="35" style="font-family:Arial; font-size:10px; color:black; font-weight:bold;">
             <xsl:value-of select="atom:category/@label"/> </td></tr>
          <tr> <td width="35" style="font-family:Arial; font-size:10px; color:black;">   <xsl:value-of select="./im:price"/>
         </td>
     </tr>
     <tr> <td>Rating: <xsl:value-of select="php:functionString('PD::parseData','$id')" disable-output-escaping="yes"/></td>
     </tr>
     </table>
     </xsl:if>
   </xsl:template>
4

1 回答 1

0

不要使用

<xsl:value-of select="php:functionString('PD::parseData','$id')" disable-output-escaping="yes"/>

使用

<xsl:value-of select="php:functionString('PD::parseData', $id)"/>

前者将字符串 "$id"而不是变量作为参数传递$id

于 2012-06-09T22:52:50.297 回答