static string module = @" <Module> <CustomerSortOrder>60</CustomerSortOrder> <LinkText_Customer>{0}</LinkText_Customer> <LocationId>4291</LocationId> <LocationModuleId>26544</LocationModuleId> <ModuleId>30</ModuleId> <ModuleName>Menu</ModuleName> <NavigateUrl>menu.aspx</NavigateUrl> <pageId>20</pageId> <IsModuleGroup>1</IsModuleGroup> <sort_order>1</sort_order> <MenuId>{1}</MenuId> </Module> "; public string AddWeekMenu(string xml2015, string xml2010) { string result = xml2015; try { XmlDocument x2015 = new XmlDocument(); x2015.LoadXml(xml2015); //step 1 find menu tag group var menutag = x2015.SelectSingleNode("//Group[Group_Name='Menu']"); //remove Menu text from second list menutag.ChildNodes[0].SelectSingleNode("//LinkText_Customer").InnerText = ""; XmlDocument x2010 = new XmlDocument(); x2010.LoadXml(xml2010); XmlNodeList m2010 = x2010.SelectNodes("//ChildNavigation[moduleid=30]"); foreach (XmlNode item in m2010) { //append menu links from 2010 AppendMenuLink(x2015, menutag, item.SelectSingleNode("ChildLinkText").InnerText, item.SelectSingleNode("ChildLinkCustomPageID").InnerText); } //updting menu tag with correct count menutag.SelectSingleNode("//numModules").InnerText = ""+m2010.Count; return x2015.OuterXml; } catch (Exception ex) { LogException(ex); } return result; }
Wednesday
add xml to xmldocument
Subscribe to:
Posts (Atom)
imagemagic add text to image
rem different types of text annotations on existing images rem cyan yellow orange gold rem -gravity SouthWest rem draw text and anno...
-
Error:The element 'Schedule' has invalid child element 'RecurrenceRule'. List of possible elements expected: 'Occurring&...
-
Perfect blog post must include following elements (from 1 to 13): 1.Big catchy header in 30px font size 2.First copy of social links and com...
-
SetKeyDelay , 75 , 75 ;Exits AutoHotKey application. $^CapsLock:: ExitApp return ;Pauses AutoHotKey Script. F6:: Pause , Toggle, 1 $x:: ...