Re: [xsl] FW: 2 XML Files, 1 XSLt Output to HTML

Subject: Re: [xsl] FW: 2 XML Files, 1 XSLt Output to HTML
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Wed, 18 Oct 2006 19:28:01 +0200
McDonald, Shaun wrote:
In case anyone is working on a solution to the problem presented in my
last post, I thought it only proper to inform you that I have discovered
an answer. It follows:


<xsl:template match="n1:share">
<xsl:variable name="x" select="@item" />
<xsl:variable name="xx" select="@loc" />
<xsl:for-each select="document(@loc)">
<xsl:for-each select="//*[@id=$x]"> <xsl:value-of select="."/>
</xsl:for-each>
</xsl:for-each>
</xsl:template>

Aha, I see. Sorry, missed that post, just spotted it. I misunderstood your question then, sorry.


But there are a few redundancies here. The xsl:for-each is not needed. And the extra variable 'xx' is not needed either. You can change your code as follows (less lines, same results)

<xsl:template match="n1:share">
   <xsl:variable name="x" select="@item" />
     <xsl:for-each select="document(@loc)//*[@id=$x]">
         <xsl:value-of select="."/>
     </xsl:for-each>
</xsl:template>

-- Abel Braaksma
  http://www.nuntia.com

Current Thread