xsl-list
[Top] [All Lists]

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

2006-10-18 10:28:35
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="//*[(_at_)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)//*[(_at_)id=$x]">
         <xsl:value-of select="."/>
     </xsl:for-each>
</xsl:template>

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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>