<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Need help to compare two sets of nodes in xsl' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Need help to compare two sets of nodes in xsl' posted on the 'XML Development' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Sat, 18 May 2013 15:03:34 -0700</pubDate>
    <lastBuildDate>Sat, 18 May 2013 15:03:34 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Need help to compare two sets of nodes in xsl</title>
      <link>http://www.programmersheaven.com/mb/xml/426063/426063/need-help-to-compare-two-sets-of-nodes-in-xsl/</link>
      <description>Here's peace of my xml: Code:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;&amp;lt;GetUserMenu&amp;gt;
&amp;lt;MenuList&amp;gt;
&amp;lt;row MenuID="1" MenuTitle="DuomenÅ³ pateikimas"/&amp;gt;
&amp;lt;/MenuList&amp;gt;
&amp;lt;FunctionList&amp;gt;
&amp;lt;row FunctionID="1" FunctionTitle="DuomenÅ³ importavimas iÅ¡ failo" MenuID="1" WorkflowName="ImportDataWithoutF
ile" Order="1"/&amp;gt;
&amp;lt;row FunctionID="2" FunctionTitle="DuomenÅ³ Ä¯vedimas" MenuID="1" WorkflowName="ImportDataFrom
File" Order="2"/&amp;gt;
&amp;lt;/FunctionList&amp;gt;
&amp;lt;/GetUserMenu&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
and peace of xsl: Code:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;&amp;lt;xsl:template match="//Authentication/GetUserMenu"&amp;gt;
        &amp;lt;div&amp;gt;
            &amp;lt;xsl:for-each select="//MenuList/row"&amp;gt;
                &amp;lt;div&amp;gt;&amp;lt;xsl:value-of select="@MenuID"/&amp;gt;&amp;lt;/div&amp;gt;
                tu
                &amp;lt;xsl:for-each select="//FunctionList/row["&amp;gt;
                    &amp;lt;div&amp;gt;&amp;lt;xsl:value-of select="@MenuID"/&amp;gt;&amp;lt;/div&amp;gt;
                &amp;lt;/xsl:for-each&amp;gt;
                tu
            &amp;lt;/xsl:for-each&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/xsl:template&amp;gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
I would like to make my xsl do this: 1)In outer for-each cycle xsl reads value of MenuId attribute of of . 2) then in inner cycle for-each my xsl compares that value to every value of MenuAttribute of 's of 3) then my xsl reads the value of MenuId attribute of following of and repeats second step&lt;br /&gt;
&lt;br /&gt;
In normal programming language what i am trying to do would look like this: foreach (xitems as xitem) foreach (yitems as yitem) if xitem == yitem do smth&lt;br /&gt;
&lt;br /&gt;
Could anyone give any advice or modify my code in order to solve my issue? I would be grateful&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/xml/426063/426063/need-help-to-compare-two-sets-of-nodes-in-xsl/</guid>
      <pubDate>Sun, 04 Dec 2011 04:33:11 -0700</pubDate>
      <category>XML Development</category>
    </item>
  </channel>
</rss>