I'm trying to parse an mvcSiteMap, I've got most of it working, but my where clause it not right. it always returns the row that the where clause should be excluding.
nodeTitle = "Bulk Order Request";
XElement xelement2 = XElement.Load( filePath );
var urlDescList1 = (xelement2.Descendants()
// Select node with 'Favorite Social Sites'
.Where( node => ( string ) node.Attribute( "title" ).Value != nodeTitle )
.SelectMany( node => node.Elements() )
.Select( node => new
{
title = node.Attribute( "title" ).Value,
url = node.Attribute( "action" ).Value
} )).ToList();
I get the same number of Rows returned whether the where clause is there or not. it's like the where clause is always true, even if the title element of the outputted lsit contains "Bulk Order Request" as its' title
I'm sure I'm doing something Obvioulsy stupid, but I can't see it.
Thanks,
Eric-
xml
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-1.0">
<mvcSiteMapNode title="Home" controller="Home" action="Index" isDynamic="true" dynamicParameters="*" >
<mvcSiteMapNode title="Home" controller="RunWebForm" action="DisplayPage/~-Scout_Main-HelloPage.aspx" roles="*" />
<mvcSiteMapNode title="Inbond Call" controller="RunWebForm" action="DisplayPage/~-Scout_HandleCall-StartCall.aspx" roles="*" />
<mvcSiteMapNode title="Reports" controller="NoController" action="NoAction/80" roles="*" >
<mvcSiteMapNode title="Activity By Type" controller="Reports" action="ActivityByType" roles="*" />
<mvcSiteMapNode title="Activity By Agent" controller="Reports" action="ActivityByAgent" roles="*" />
<mvcSiteMapNode title="Activity By Language" controller="Reports" action="ActivityByLang" roles="*" />
<mvcSiteMapNode title="Complaints" controller="Reports" action="ComplaintReport" roles="*" />
<mvcSiteMapNode title="Volume by Date Time" controller="Reports" action="VolumeByDateTime" roles="*" />
<mvcSiteMapNode title="Activity By Gender" controller="Reports" action="CallPersonActivityByGenderReport" roles="*" />
<mvcSiteMapNode title="Prospects by Age" controller="Reports" action="ActivitybyProspectsbyAge" roles="*" />
<mvcSiteMapNode title="Prospects by Ethnicity" controller="Reports" action="ActivitybyEthnicity" roles="*" />
<mvcSiteMapNode title="Prospects by Gender" controller="Reports" action="ActivitybyGender" roles="*" />
<mvcSiteMapNode title="Prospects by Language" controller="Reports" action="ActivitybyLanguage" roles="*" />
<mvcSiteMapNode title="Activity by Referral Source" controller="Reports" action="ActivitybyReferralSource" roles="*" />
</mvcSiteMapNode>
<mvcSiteMapNode title="Fullfillment letter" controller="NoController" action="NoAction/9" roles="*" >
<mvcSiteMapNode title="Bulk Order Request" controller="Reports" action="ActivityByBulkOrderRequest" roles="*" />
<mvcSiteMapNode title="Letter English" controller="Reports" action="LetterEnglish" roles="*" />
<mvcSiteMapNode title="Letter English - General Inquiry" controller="Reports" action="LetterEnglishForGeneralInquiry" roles="*" />
</mvcSiteMapNode>
<mvcSiteMapNode title="Maintenance" description="Maintenance" controller="NoController" action="NoAction/11" roles="4048">
<mvcSiteMapNode controller="RunWebForm" action="DisplayPage/~-Scout_Main-Administration-MaintainScripts.aspx" title="Maintain Call Scripts " description="Maintain Call Scripts" roles="4048"/>
<mvcSiteMapNode controller="RunWebForm" action="DisplayPage/~-Scout_Main-Administration-MediaTypeMaintain.aspx" title="Maintain Media Items " description="Maintain Media Items" roles="4048"/>
<mvcSiteMapNode controller="RunWebForm" action="DisplayPage/~-Scout_Main-Administration-CallMainSource.aspx" title="Maintain Call Main Sources " description="Maintain Call Main Sources" roles="4048"/>
<mvcSiteMapNode controller="RunWebForm" action="DisplayPage/~-Scout_Main-Administration-CallSecondarySource.aspx" title="Maintain Call Secondary Sources " description="Maintain Call Secondary Sources" roles="4048"/>
<mvcSiteMapNode controller="RunWebForm" action="DisplayPage/~-Scout_Main-Administration-CallOtherLanguage.aspx" title="Maintain Additional Languages" description="Maintain Additional Languages" roles="4048"/>
</mvcSiteMapNode>
<mvcSiteMapNode controller="Account" action="Logon" title="Logout" description="Logout and return to the login screen" roles="*" />
</mvcSiteMapNode>
</siteMap>