入力 XML ファイルで相対パスが指定されている XML ファイルをマージ (およびメタ情報を追加) しようとしています。マージしたいファイルは「files」というサブディレクトリにあります入力ファイルの構造は次のとおりです
<files>
<file>
<path>files/firstfile.xml</path>
</file>
<file>
<path>files/secondfile.xml</path>
</file>
</files>
firstfile.xml と secondfile.xml の構造は次のとおりです。
<tables>
<table name = "...">
...
</table>
...
<tables>
1 つのファイルのすべてのテーブル ノードをグループに入れ、それにメタ情報を追加したいと考えています。そこで、次の XSLT スタイルシートを作成しました。
<xsl:template match="/">
<tables>
<xsl:apply-templates/>
</tables>
</xsl:template>
<xsl:template name = "enrichWithMetaInformation" match = "file">
<xsl:apply-templates select="document(./path)/tables">
<xsl:with-param name="file" select="."/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="tables">
<group>
<meta>
...Some meta data ...
</meta>
<xsl:copy-of select="./table"/>
</group>
</xsl:template>
すべてのファイルについて、エラーが発生します。
指定されたファイルが見つかりませんでした。
空のノード セットが返されたことを示しています (そのため、ファイルをロードできませんでした)。この問題を解決する方法を知っている人はいますか?
乾杯