2つのxslファイルを1つにまとめる必要があります。私は試みたが、私はそうしていない。これらのxslファイルはどちらも別々に正常に動作しますが、それらを組み合わせるとうまく動作しません。私はxslの専門家ではない。ここで 2つのxmlファイルを結合する
は、最初のXSLファイルです:
<xsl:variable name="products" select="document('T01_product.xml')/products"/>
<xsl:strip-space elements="*"/>
<xsl:key name="product" match="product" use="pm-id" />
<!-- identity transform -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="deleted-assignment/pm-id">
<xsl:copy-of select="."/>
<xsl:copy-of select="key('product', .)/art-num"/>
</xsl:template>
</xsl:stylesheet>
二XSLファイルは事前に
<xsl:variable name="items" select="document('T01_item.xml')/items"/>
<xsl:strip-space elements="*"/>
<xsl:key name="item" match="item" use="pm-id" />
<!-- identity transform -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="deleted-assignment/pm-id">
<xsl:copy-of select="."/>
<xsl:copy-of select="key('item', .)/art-num"/>
</xsl:template>
</xsl:stylesheet>
おかげで