私はxsltで何かを変換しています.xalan関数document-location
が利用可能な場合はそれを利用しようとし、それ以外の場合はそれを避けています(移植可能)。サンプルコード:
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<xsl:choose>
<xsl:when test="function-available('document-location')">
<xsl:message>YES document-location
</xsl:message>
<xsl:message><xsl:value-of select="document-location()"/></xsl:message>
</xsl:when>
<xsl:otherwise>
<xsl:message>NO document-location
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:transform>
サクソンレポート
SAXON 6.5.5 from Michael Kay
Java version 1.7.0_151
Error at xsl:value-of on line 8 of file:minisax.xsl:
Error in expression document-location(): Unknown system function: document-location
Transformation failed: Failed to compile stylesheet. 1 error detected.
機能の利用可能性はテスト前ですが、使ってみます。「制御」がそこまで到達する前に使おうとしているようです。
xalanj で正しく動作しますが (簡単です)、xsltproc でも動作します。
どうすればこれを機能させることができますか?
編集/背景
これは、私の Renderx XEP 評価版に同梱されている saxon バージョンであり、すぐに使える移植可能なスタイルシートを作成するのが困難です。古いバージョンのため、現在のサクソンの問題ではないことは理解しています。