我正在 iPhone 模拟器上执行 selenium 脚本,我正在通过 ios-server0.6.3.jar 运行服务器。我可以通过在 safari 浏览器上运行脚本来获取 Mac 上的所有 xslt 报告,但是当我尝试在 iPhone 模拟器上执行相同的脚本时,得到以下 xslt 异常..
[xslt] Processing /test-output/testng-results.xml to /XSLT_Reports/output/index.html
[xslt] Loading stylesheet /src/xslt/testng-results.xsl
[xslt] /src/xslt/testng-results.xsl:461:93:
Fatal Error! Cannot find a matching 1-argument function named {http://exslt.org/math}cos().
There is no Saxon extension function with the local name cos
[xslt] /src/xslt/testng-results.xsl:462:98: Fatal Error! Cannot find a matching 1-argument function named {http://exslt.org/math}sin(). There is no Saxon extension function with the local name sin
[xslt] /src/xslt/testng-results.xsl:466:111: Fatal Error! Cannot find a matching 1-argument function named {http://exslt.org/math}cos(). There is no Saxon extension function with the local name cos
[xslt] /src/xslt/testng-results.xsl:467:118: Fatal Error! Cannot find a matching 1-argument function named {http://exslt.org/math}sin(). There is no Saxon extension function with the local name sin
以下代码可能会产生问题:
<xsl:variable name="pi" select="3.141592"/>
<xsl:variable name="radius" select="130"/>
<xsl:variable name="failedPercent" select="format-number($failedCount div $totalCount, '###%')"/>
<xsl:variable name="failedAngle" select="($failedCount div $totalCount) * $pi * 2"/>
<xsl:variable name="failedX" select="$radius * math:cos($failedAngle)"/>
<xsl:variable name="failedY" select="-1 * $radius * math:sin($failedAngle)"/>
<xsl:variable name="failedArc" select="if ($failedAngle >= $pi) then 1 else 0"/>
<xsl:variable name="failedAngle_text" select="$failedAngle div 2"/>
<xsl:variable name="failedX_text" select="($radius div 2) * math:cos($failedAngle_text)"/>
<xsl:variable name="failedY_text" select="(-1 * ($radius div 2) * math:sin($failedAngle_text))"/>