Guest User

Untitled

a guest
Jan 18th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. <WindowBuilderProject>
  2. <stringtable>
  3.  
  4. <stentry>0..607</stentry> //All of the other records
  5.  
  6. <stentry>
  7. <index>608</index>
  8. <sid>MNUB_AUTO</sid>
  9. <val>
  10. <en>AUTO</en>
  11. </val>
  12. <params>
  13. <fontref>0</fontref>
  14. <numref>0</numref>
  15. <clip>FALSE</clip>
  16. <include>TRUE</include>
  17. <protected>FALSE</protected>
  18. <cwidth>-1</cwidth>
  19. <dwidth>0</dwidth>
  20. </params>
  21. </stentry>
  22.  
  23. </stringtable>
  24. </WindowBuilderProject>
  25.  
  26. string location = "/WindowBuilderProject/stringtable/stentry[index='" + rowIndexOfItemUnderMouseToDrop + "']";
  27. XmlNode Copy = xDoc.ImportNode(xDoc2.SelectSingleNode(location), false);
  28. xDoc.DocumentElement.AppendChild(Copy); //This is just supposed to add it to the end, I will worry about ordering once it works
  29.  
  30. var xDoc1 = XDocument.Load("C:\text1.xml");
  31. var xDoc2 = XDocument.Load("C:\text2.xml");
  32.  
  33. var doc1Entries = xDoc1.Descendants("stentry");
  34.  
  35. var cloneEntries = doc1Entries.Select(x => new XElement(x));
  36. xDoc2.Descendants("stentry").Last().AddAfterSelf(cloneEntries);
  37.  
  38. xDoc2.Save("C:\text2.xml");
  39.  
  40. var filterIndices = new[] {600, 601, 700, 705};
  41.  
  42. var doc1Entries =
  43. xDoc1.Descendants("stentry")
  44. .Where(x =>
  45. filterIndices.Contains(int.Parse(x.Element("index").Value)));
Add Comment
Please, Sign In to add comment