P
Porthos
Here's yet another question. Thanks for your patience/advice. I am
trying to match attributes from different paths in different files and
display an attribute of the subordinate tag in the second file when
they match. But I seem to only get the last value of that subordinate
tag attribute over and over. Any thoughts? I'm pretty sure that the
problem lies in my referencing absolouts paths from the 'when' tag.
-James
Document 1 (doc1.xml)
------------------------
<AA>
<BB author="McFly">
<CC title="Back to the Future">00-00-00-01</CC>
</BB>
<BB author="Bartakamous">
<CC title="Perfect Strangers">00-00-00-02</CC>
</BB>
</AA>
Document 2 (doc2.xml)
------------------------
<MM>
<NN author="McFly">
<OO dob="08.25.1980">
<!-- Additional Unrelated Tags -->
</OO>
</NN>
<NN author="Bartakamous">
<OO dob="02.15.1962">
<!-- Additional Unrelated Tags -->
</OO>
</NN>
<NN author="Mclain">
<OO dob="12.01.1899">
<!-- Additional Unrelated Tags -->
</OO>
</NN>
</MM>
XSL Document
------------------------
<xsl:for-each select="AA/BB">
<!-- Unrelated processing instructions -->
<xsl:for-each select"AA/BB>
<!-- Unrelated processing instructions -->
<xsl:for-each select="CC/@title">
<xsl:for-each select="document('doc2.xml')/MM">
<!-- Unrelated processing instructions -->
<xsl:choose>
<xsl:when test="document('doc1.xml')/AA/BB/@author=@author">
<xsl:value-of select="NN/OO/@dob"/>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
Result
trying to match attributes from different paths in different files and
display an attribute of the subordinate tag in the second file when
they match. But I seem to only get the last value of that subordinate
tag attribute over and over. Any thoughts? I'm pretty sure that the
problem lies in my referencing absolouts paths from the 'when' tag.
-James
Document 1 (doc1.xml)
------------------------
<AA>
<BB author="McFly">
<CC title="Back to the Future">00-00-00-01</CC>
</BB>
<BB author="Bartakamous">
<CC title="Perfect Strangers">00-00-00-02</CC>
</BB>
</AA>
Document 2 (doc2.xml)
------------------------
<MM>
<NN author="McFly">
<OO dob="08.25.1980">
<!-- Additional Unrelated Tags -->
</OO>
</NN>
<NN author="Bartakamous">
<OO dob="02.15.1962">
<!-- Additional Unrelated Tags -->
</OO>
</NN>
<NN author="Mclain">
<OO dob="12.01.1899">
<!-- Additional Unrelated Tags -->
</OO>
</NN>
</MM>
XSL Document
------------------------
<xsl:for-each select="AA/BB">
<!-- Unrelated processing instructions -->
<xsl:for-each select"AA/BB>
<!-- Unrelated processing instructions -->
<xsl:for-each select="CC/@title">
<xsl:for-each select="document('doc2.xml')/MM">
<!-- Unrelated processing instructions -->
<xsl:choose>
<xsl:when test="document('doc1.xml')/AA/BB/@author=@author">
<xsl:value-of select="NN/OO/@dob"/>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
Result