変数を使用してそれを実現できます。
<xsl:variable name="titles" select="../destination/@title"/>
<!--now "titles" contains a nodeset with all the titles -->
<xsl:for-each select="../../../../fieldmaps/field[@name=$titles]">
<!-- you process each field with a name contained inside the titles nodeset -->
</xsl:for-each>
簡単な例を次に示します。
入力:
<parent>
<fieldmaps>
<field name="One"/>
<field name="Two"/>
<field name="Three"/>
</fieldmaps>
<destinations>
<destination title="One"/>
<destination title="Two"/>
</destinations>
</parent>
テンプレート:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- ++++++++++++++++++++++++++++++++ -->
<xsl:template match="parent">
<Results>
<xsl:variable name="titles" select="destinations/destination/@title"/>
<xsl:for-each select="fieldmaps/field[@name=$titles]">
<Result title="{@name}"/>
</xsl:for-each>
</Results>
</xsl:template>
<!-- ++++++++++++++++++++++++++++++++ -->
</xsl:stylesheet>
出力:
<Results>
<Result title="One"/>
<Result title="Two"/>
</Results>
これが役立つことを願っています!