XML Development

Moderators: None (Apply to moderate this forum)
Number of threads: 252
Number of posts: 451

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Need help to compare two sets of nodes in xsl Posted by WLV on 4 Dec 2011 at 4:36 AM
Here's peace of my xml: Code:

<GetUserMenu>
<MenuList>
<row MenuID="1" MenuTitle="Duomenų pateikimas"/>
</MenuList>
<FunctionList>
<row FunctionID="1" FunctionTitle="Duomenų importavimas iÅ¡ failo" MenuID="1" WorkflowName="ImportDataWithoutFile" Order="1"/>
<row FunctionID="2" FunctionTitle="Duomenų įvedimas" MenuID="1" WorkflowName="ImportDataFromFile" Order="2"/>
</FunctionList>
</GetUserMenu>

and peace of xsl: Code:

<xsl:template match="//Authentication/GetUserMenu">
        <div>
            <xsl:for-each select="//MenuList/row">
                <div><xsl:value-of select="@MenuID"/></div>
                tu
                <xsl:for-each select="//FunctionList/row[">
                    <div><xsl:value-of select="@MenuID"/></div>
                </xsl:for-each>
                tu
            </xsl:for-each>
        </div>
    </xsl:template>


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

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

Could anyone give any advice or modify my code in order to solve my issue? I would be grateful




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.