これについて Java と C を参照する多くの例を見つけましたが、XSL を使用して外部ファイルの存在を確認するにはどうすればよいですか、または確認できますか。
まず、これは単なるスニペットであることに気付きましたが、これは巨大なスタイルシートの一部であるため、私の問題を示すのに十分であることを願っています.
<!-- Use this template for Received SMSs -->
<xsl:template name="ReceivedSMS">
<!-- Set/Declare "SMSname" variable (local, evaluates per instance) -->
<xsl:variable name="SMSname">
<xsl:value-of select=" following-sibling::Name"/>
</xsl:variable>
<fo:table font-family="Arial Unicode MS" font-size="8pt" text-align="start">
<fo:table-column column-width=".75in"/>
<fo:table-column column-width="6.75in"/>
<fo:table-body>
<fo:table-row>
<!-- Cell contains "speakers" icon -->
<fo:table-cell display-align="after">
<fo:block text-align="start">
<fo:external-graphic src="../images/{$SMSname}.jpg" content-height="0.6in"/>
私がやりたいことは、{$SMSname}.jpg
行を囲む「if」ステートメントに入れられます。あれは:
<fo:block text-align="start">
<xsl:if test="exists( the external file {$SMSname}.jpg)">
<fo:external-graphic src="../images/{$SMSname}.jpg" content-height="0.6in"/>
</xsl:if>
<xsl:if test="not(exists( the external file {$SMSname}.jpg))">
<fo:external-graphic src="../images/unknown.jpg" content-height="0.6in"/>
</xsl:if>
</fo:block>
「グループ化」などのため、XSLT 2.0 を使用しています。これが実現できることを願っています。それが単純なものであることをさらに願っています。
いつものように、助けてくれてありがとう。LO