Author Topic: Linq to XML Selection issue.  (Read 4263 times)

0 Members and 1 Guest are viewing this topic.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Linq to XML Selection issue.
« on: January 02, 2014, 07:41:05 AM »
I'm brain dead.
I have an XML file that I'm querying

The file:
Code - XML: [Select]
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <PRT-data>
  3.         <File> "MEMBER"</File>
  4.         <member>
  5.                 <next_id> "10"</next_id>
  6.                 <version> "5.0.0.271"</version>
  7.                 <info>
  8.                         <item_tag> "test-a6-2"</item_tag>
  9.                         <length> "750"</length>
  10.                         <mark> "TEST-A6-2"</mark>
  11.                         <material> "1"</material>
  12.                         <shipping> "1"</shipping>
  13.                         <type> "TEST"</type>
  14.                 </info>
  15.                 <mbr_con>
  16.                         <auto_item> "71"</auto_item>
  17.                         <con_id> "1"</con_id>
  18.                         <name> "WALL PL"</name>
  19.                         <connection>
  20.                                 <height> "50"</height>
  21.                                 <width> "55"</width>
  22.                                 <thickness> "10"</thickness>
  23.                         </connection>
  24.                         <layer>
  25.                                 <full> "ST35"</full>
  26.                                 <hidden> "STH18"</hidden>
  27.                                 <solid> "3dCH-6"</solid>
  28.                         </layer>
  29.                 </mbr_con>
  30.                 <mbr_con>
  31.                         <auto_item> "72"</auto_item>
  32.                         <con_id> "2"</con_id>
  33.                         <name> "WALL PL"</name>
  34.                         <connection>
  35.                                 <height> "100"</height>
  36.                                 <width> "105"</width>
  37.                                 <thickness> "10"</thickness>
  38.                         </connection>
  39.                         <layer>
  40.                                 <full> "ST35"</full>
  41.                                 <hidden> "STH18"</hidden>
  42.                                 <solid> "3dCH-6"</solid>
  43.                         </layer>
  44.                 </mbr_con>
  45.                 <mbr_con>
  46.                         <auto_item> "73"</auto_item>
  47.                         <con_id> "3"</con_id>
  48.                         <name> "WALL PL"</name>
  49.                         <connection>
  50.                                 <height> "150"</height>
  51.                                 <width> "155"</width>
  52.                                 <thickness> "10"</thickness>
  53.                         </connection>
  54.                         <layer>
  55.                                 <full> "ST35"</full>
  56.                                 <hidden> "STH18"</hidden>
  57.                                 <solid> "3dCH-6"</solid>
  58.                         </layer>
  59.                 </mbr_con>
  60.                 <mbr_con>
  61.                         <auto_item> "74"</auto_item>
  62.                         <con_id> "4"</con_id>
  63.                         <name> "WALL PL"</name>
  64.                         <connection>
  65.                                 <height> "200"</height>
  66.                                 <width> "205"</width>
  67.                                 <thickness> "10"</thickness>
  68.                         </connection>
  69.                         <layer>
  70.                                 <full> "ST35"</full>
  71.                                 <hidden> "STH18"</hidden>
  72.                                 <solid> "3dCH-6"</solid>
  73.                         </layer>
  74.                 </mbr_con>
  75.         </member>
  76. </PRT-data>
  77.  
  78.  

The Source :
Code - C#: [Select]
  1. using System;
  2. using System.Diagnostics;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using System.Collections.Specialized;
  6. using System.Text;
  7. using System.Linq;
  8. using System.Xml;
  9. using System.Xml.Linq;
  10. using System.Xml.Schema;
  11. using System.Xml.XPath;
  12. using System.Xml.Xsl;
  13. using System.IO;
  14. using System.Threading;
  15. using System.Reflection;
  16.  
  17.  
  18. namespace Read_Write_tsd_stuff
  19. {
  20.     partial class Program
  21.     {
  22.         static void Test08()
  23.         {
  24.             string xmlFile = @"D:\_VSDev\VS2013\TSD-Read-Write\MBRS\TEST-1\M6111-A6-2A.XML";
  25.  
  26.             XElement  xe = XElement.Load(xmlFile);
  27.  
  28.             IEnumerable<XElement> allKeys = xe.Elements("member");
  29.             // ===================
  30.             Console.WriteLine("\n xe0 -----------------------------------");
  31.             // Read the entire XML
  32.             foreach (var key in allKeys)
  33.             {
  34.                 Console.WriteLine(key);
  35.             }
  36.             //// ===================
  37.             var xe1 =
  38.                 from key in allKeys.Elements("version")
  39.                 select key;
  40.             foreach (var key in xe1)
  41.             {
  42.                 Console.WriteLine("\n xe1 -----------------------------------");
  43.                 Console.WriteLine(key);
  44.                 Console.WriteLine(key.Value);
  45.             }
  46.             //// ===================
  47.             var xe2 =
  48.                 from key in allKeys.Descendants("info")
  49.                 select key;
  50.             foreach (var key in xe2)
  51.             {
  52.                 Console.WriteLine("\n xe2  -----------------------------------");
  53.                 Console.WriteLine(key.Element("mark"));
  54.                 Console.WriteLine(key.Element("length"));
  55.             }
  56.             //// ===================
  57.             var xe3 =
  58.                 from item in allKeys.Descendants("mbr_con")
  59.                 select item;
  60.  
  61.             Console.WriteLine("\n xe3 -----------------------------------");
  62.             Console.WriteLine("mbr_cons Count = {0}", xe3.Count());
  63.             foreach (var key in xe3)
  64.             {
  65.                 Console.WriteLine("-----------------------------------");
  66.                 Console.WriteLine("con_id {0} :", key.Element("con_id").Value);
  67.                 Console.WriteLine(key);
  68.             }
  69.             //// ===================
  70.             var xe4 =
  71.                 from item in xe.Elements("member")
  72.                 where (string)item.Element("mbr_con").Element("con_id").Value == "1"
  73.                 select item;
  74.  
  75.             Console.WriteLine(" xe4 -----------------------------------");
  76.             Console.WriteLine("mbr_cons Count = {0}", xe4.Count());
  77.             foreach (var key in xe4)
  78.             {
  79.                 Console.WriteLine("-----------------------------------");
  80.                 Console.WriteLine("con_id {0} :", key.Element("con_id").Value);
  81.                 Console.WriteLine(key);
  82.             }
  83.             //// ===================
  84.  
  85.             Console.ReadLine();
  86.  
  87.         }
  88.  
  89.     }
  90. }
  91.  
  92.  

The result:

Code - Text: [Select]
  1.  
  2.  
  3.  xe0 -----------------------------------
  4. <member>
  5.   <next_id> "10"</next_id>
  6.   <version> "5.0.0.271"</version>
  7.   <info>
  8.     <item_tag> "test-a6-2"</item_tag>
  9.     <length> "750"</length>
  10.     <mark> "TEST-A6-2"</mark>
  11.     <material> "1"</material>
  12.     <shipping> "1"</shipping>
  13.     <type> "TEST"</type>
  14.   </info>
  15.   <mbr_con>
  16.     <auto_item> "71"</auto_item>
  17.     <con_id> "1"</con_id>
  18.     <name> "WALL PL"</name>
  19.     <connection>
  20.       <height> "50"</height>
  21.       <width> "55"</width>
  22.       <thickness> "10"</thickness>
  23.     </connection>
  24.     <layer>
  25.       <full> "ST35"</full>
  26.       <hidden> "STH18"</hidden>
  27.       <solid> "3dCH-6"</solid>
  28.     </layer>
  29.   </mbr_con>
  30.   <mbr_con>
  31.     <auto_item> "72"</auto_item>
  32.     <con_id> "2"</con_id>
  33.     <name> "WALL PL"</name>
  34.     <connection>
  35.       <height> "100"</height>
  36.       <width> "105"</width>
  37.       <thickness> "10"</thickness>
  38.     </connection>
  39.     <layer>
  40.       <full> "ST35"</full>
  41.       <hidden> "STH18"</hidden>
  42.       <solid> "3dCH-6"</solid>
  43.     </layer>
  44.   </mbr_con>
  45.   <mbr_con>
  46.     <auto_item> "73"</auto_item>
  47.     <con_id> "3"</con_id>
  48.     <name> "WALL PL"</name>
  49.     <connection>
  50.       <height> "150"</height>
  51.       <width> "155"</width>
  52.       <thickness> "10"</thickness>
  53.     </connection>
  54.     <layer>
  55.       <full> "ST35"</full>
  56.       <hidden> "STH18"</hidden>
  57.       <solid> "3dCH-6"</solid>
  58.     </layer>
  59.   </mbr_con>
  60.   <mbr_con>
  61.     <auto_item> "74"</auto_item>
  62.     <con_id> "4"</con_id>
  63.     <name> "WALL PL"</name>
  64.     <connection>
  65.       <height> "200"</height>
  66.       <width> "205"</width>
  67.       <thickness> "10"</thickness>
  68.     </connection>
  69.     <layer>
  70.       <full> "ST35"</full>
  71.       <hidden> "STH18"</hidden>
  72.       <solid> "3dCH-6"</solid>
  73.     </layer>
  74.   </mbr_con>
  75. </member>
  76.  
  77.  xe1 -----------------------------------
  78. <version> "5.0.0.271"</version>
  79.  "5.0.0.271"
  80.  
  81.  xe2  -----------------------------------
  82. <mark> "TEST-A6-2"</mark>
  83. <length> "750"</length>
  84.  
  85.  xe3 -----------------------------------
  86. mbr_cons Count = 4
  87. -----------------------------------
  88. con_id  "1" :
  89. <mbr_con>
  90.   <auto_item> "71"</auto_item>
  91.   <con_id> "1"</con_id>
  92.   <name> "WALL PL"</name>
  93.   <connection>
  94.     <height> "50"</height>
  95.     <width> "55"</width>
  96.     <thickness> "10"</thickness>
  97.   </connection>
  98.   <layer>
  99.     <full> "ST35"</full>
  100.     <hidden> "STH18"</hidden>
  101.     <solid> "3dCH-6"</solid>
  102.   </layer>
  103. </mbr_con>
  104. -----------------------------------
  105. con_id  "2" :
  106. <mbr_con>
  107.   <auto_item> "72"</auto_item>
  108.   <con_id> "2"</con_id>
  109.   <name> "WALL PL"</name>
  110.   <connection>
  111.     <height> "100"</height>
  112.     <width> "105"</width>
  113.     <thickness> "10"</thickness>
  114.   </connection>
  115.   <layer>
  116.     <full> "ST35"</full>
  117.     <hidden> "STH18"</hidden>
  118.     <solid> "3dCH-6"</solid>
  119.   </layer>
  120. </mbr_con>
  121. -----------------------------------
  122. con_id  "3" :
  123. <mbr_con>
  124.   <auto_item> "73"</auto_item>
  125.   <con_id> "3"</con_id>
  126.   <name> "WALL PL"</name>
  127.   <connection>
  128.     <height> "150"</height>
  129.     <width> "155"</width>
  130.     <thickness> "10"</thickness>
  131.   </connection>
  132.   <layer>
  133.     <full> "ST35"</full>
  134.     <hidden> "STH18"</hidden>
  135.     <solid> "3dCH-6"</solid>
  136.   </layer>
  137. </mbr_con>
  138. -----------------------------------
  139. con_id  "4" :
  140. <mbr_con>
  141.   <auto_item> "74"</auto_item>
  142.   <con_id> "4"</con_id>
  143.   <name> "WALL PL"</name>
  144.   <connection>
  145.     <height> "200"</height>
  146.     <width> "205"</width>
  147.     <thickness> "10"</thickness>
  148.   </connection>
  149.   <layer>
  150.     <full> "ST35"</full>
  151.     <hidden> "STH18"</hidden>
  152.     <solid> "3dCH-6"</solid>
  153.   </layer>
  154. </mbr_con>
  155.  xe4 -----------------------------------
  156. mbr_cons Count = 0
  157.  
  158.  
  159.  

The problem : perhaps misguided expectations

I expected the result for xe4 to be the same as the first part of xe3 ; that is return ONLY the block(s) which contain a "con_id" of "1"
and I expected the collection count to be 1.

This is a learning exercise and not time critical ... just trying to fit it into a bit of spare time I've made.
Anyone got any ideas regarding where I've gone wrong. I haven't researched this as well as I'd like.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Linq to XML Selection issue.
« Reply #1 on: January 02, 2014, 10:55:04 AM »
Going to post a project a little later, but Element gets first child with name, and in ConsoleWriteLine uses Element again so looking for child element "con_id" in "con_id".




MexicanCustard

  • Swamp Rat
  • Posts: 705
Re: Linq to XML Selection issue.
« Reply #2 on: January 02, 2014, 01:06:41 PM »
Code - C#: [Select]
  1.  var xe4 =
  2.                 from item in xe.Elements("member")
  3.                 where (string)item.Element("mbr_con").Element("con_id").Value == "1"
  4.                 select item;

item.Element() is returning an IEnumerable so this statement isn't legal. I see now that you were calling Element() not Elements(). So from a quick glance not sure why you're not getting the result you expected.

Try something like this.
Code - C#: [Select]
  1.  var xe4 =
  2.                 from item in xe.Elements("member")
  3.                 let mbrs = item.Elements("mbr_con")
  4.                 from mbr in mbrs
  5.                 let conIds = mbr.Elements("con_id")
  6.                 from id in conIds
  7.                 where id.Value == "1"
  8.                 select item;

*EDIT*: Forgot the con_id element
« Last Edit: January 02, 2014, 01:24:33 PM by MexicanCustard »
Revit 2019, AMEP 2019 64bit Win 10

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Linq to XML Selection issue.
« Reply #3 on: January 02, 2014, 01:49:47 PM »
Code - C#: [Select]
  1.             Console.WriteLine(" xe4 -----------------------------------");
  2.             Console.WriteLine("mbr_cons Count = {0}", xe4.Count());
  3.             foreach (var key in xe4)
  4.             {
  5.                 Console.WriteLine("-----------------------------------");
  6.                 Console.WriteLine("con_id {0} :", key.Element("con_id").Value);
  7.                 Console.WriteLine(key);
  8.             }
  9.  
  10.  

As mentioned previously it looking another child named "con_id" when key.Element("con_id")

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Linq to XML Selection issue.
« Reply #4 on: January 02, 2014, 05:27:06 PM »
< .. >

Try something like this.
Code - C#: [Select]
  1.  var xe4 =
  2.                 from item in xe.Elements("member")
  3.                 let mbrs = item.Elements("mbr_con")
  4.                 from mbr in mbrs
  5.                 let conIds = mbr.Elements("con_id")
  6.                 from id in conIds
  7.                 where id.Value == "1"
  8.                 select item;


Thanks for the responses guys.
I tried several variations on that ... the IEnumerable xe4 is still null so the count is still 0

This is very frustrating. I'll have another play tonight.
Code - C#: [Select]
  1.  
  2.             //// ===================
  3.             var xe4 =
  4.                 from con in allKeys.Descendants("mbr_con")
  5.                 let conIds = con.Elements("con_id")
  6.                 from id in conIds
  7.                 where id.Value == "1"
  8.                 select con;
  9.  
  10.                 //from item in xe.Elements("member")
  11.                 //let mbrs = item.Elements("mbr_con")
  12.                 //from mbr in mbrs
  13.                 //let conIds = mbr.Elements("con_id")
  14.                 //from id in conIds
  15.                 //where id.Value == "1"
  16.                 //select item;
  17.  
  18.             Console.WriteLine(" xe4 -----------------------------------");
  19.             Console.WriteLine("con_id Count = {0}", xe4.Count());
  20.             foreach (var key in xe4)
  21.             {
  22.                 Console.WriteLine("-----------------------------------");
  23.                 Console.WriteLine("con_id {0} :", key.Element("con_id").Value);
  24.                 Console.WriteLine(key);
  25.             }
  26.             //// ===================
  27.  
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Linq to XML Selection issue.
« Reply #5 on: January 02, 2014, 05:54:15 PM »
Little tied down but got project set up with unit tests. Nothing new to you but for anyone else who has never used them might help.
Will post later.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Linq to XML Selection issue.
« Reply #6 on: January 02, 2014, 05:58:06 PM »
Thanks Jeff. That sounds Great.
As you know LINQ stuff is not easy to debug and step through.

The XML is fashioned manually for simplicity. The original XML is a bit over 3000 lines long and is being created programmatically from a raw text file with a proprietary format .. at least I have that part working to my satisfaction :)
« Last Edit: January 02, 2014, 06:06:26 PM by Kerry »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Linq to XML Selection issue.
« Reply #7 on: January 02, 2014, 06:33:12 PM »

This failed also

Code - C#: [Select]
  1.  
  2.             var xe4 =
  3.                 from c in xe.Elements("member")
  4.                 where (from n in c.Elements("mbr_con") where            
  5.                            (string)n.Element("con_id") == "1" select n).Any()  
  6.                 select c;
  7.  
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Linq to XML Selection issue.
« Reply #8 on: January 02, 2014, 10:14:12 PM »
It's that space that got me, but working on this machine

Code - C#: [Select]
  1.             var xe4 =
  2.                 xe.Descendants("con_id")
  3.                 .Where(d => d.Value == " \"1\"");
  4.  

or
Code - C#: [Select]
  1.              var xe4 = xe.Elements("member")
  2.                  .Elements("mbr_con")
  3.                  .Where(ele => ele.Element("con_id").Value == " \"1\"");
  4.  


Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Linq to XML Selection issue.
« Reply #9 on: January 02, 2014, 11:14:01 PM »
Thanks Jeff .. brilliant.

I edited the xml to remove the space and this worked.

Code - C#: [Select]
  1.             var xe4 =                
  2.                  allKeys
  3.                  .Elements("mbr_con")
  4.                  .Where(ele => ele.Element("con_id").Value == "\"1\"");
  5.  

When I wrote the parser I ignored that the values were automatically strings. duh!

When I modified the XML so the values weren't quoted this worked.
ie the xml is now :

Code - XML: [Select]
  1.                 <mbr_con>
  2.                         <auto_item>71</auto_item>
  3.                         <con_id>1</con_id>
  4.                         <name>WALL PL</name>
  5.                         <connection>
  6.                                 <height>50</height>
  7.                                 <width>55</width>
  8.                                 <thickness>10</thickness>
  9.                         </connection>
  10.                         <layer>
  11.                                 <full>ST35</full>
  12.                                 <hidden>STH18</hidden>
  13.                                 <solid>3dCH-6</solid>
  14.                         </layer>
  15.                 </mbr_con>
  16.  

So this works.
Code - C#: [Select]
  1.             var xe4 =                
  2.                  allKeys
  3.                  .Elements("mbr_con")
  4.                  .Where(ele => ele.Element("con_id").Value == "1");
  5.  

I'll revise the translation parser tonight and see how that goes.

Thanks for the eyes and the effort Jeff, appreciated muchly.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

MickD

  • King Gator
  • Posts: 3639
  • (x-in)->[process]->(y-out) ... simples!
Re: Linq to XML Selection issue.
« Reply #10 on: January 03, 2014, 12:27:19 AM »
Hi Kerry,
I was playing around with this using XPath and the quoted numbers (i.e. "1") were giving me all sorts of trouble, removed the quotes and all was easy, code below for shiggles.

edit: in fact I think you are supposed to only use mark up for things like quotes etc. eg. &quot; for " and the quotes are not required for strings in general.
edit2: doh, I see you already worked that out :P

Code - C#: [Select]
  1.         static void Main()
  2.         {
  3.             XmlDocument xmlDoc = new XmlDocument();
  4.             xmlDoc.Load(@"C:\00-Job folders\Temp stuff\KWB_data.XML");
  5.  
  6.             XmlNamespaceManager nsMgr = new XmlNamespaceManager(xmlDoc.NameTable);
  7.            
  8.  
  9.             XmlNodeList selectedNodes = xmlDoc.SelectNodes("/PRT-data/member/mbr_con[con_id = \"1\"]", nsMgr);
  10.             Console.WriteLine("mbr_cons Count = {0}", selectedNodes.Count);
  11.            
  12.             foreach (XmlNode selectedNode in selectedNodes)
  13.             {
  14.                     Console.WriteLine("-----------------------------------");
  15.                     XmlNodeList childNodes = selectedNode.ChildNodes;
  16.                     foreach (XmlNode node in childNodes)
  17.                     {
  18.                         Console.WriteLine("Node {0} : \n", node.Name);
  19.  
  20.                         // if it has more child nodes, print them out:
  21.                         if(node.HasChildNodes)
  22.                         {
  23.                             XmlNodeList childNodes1 = node.ChildNodes;
  24.                             foreach(XmlNode n in childNodes1)
  25.                             {
  26.                                 Console.WriteLine("     {0} : {1} \n", n.Name, n.InnerText);
  27.                             }
  28.                         }
  29.                     }
  30.             }
  31.  
  32.             Console.ReadLine();
  33.  
  34.         }
« Last Edit: January 03, 2014, 01:10:11 AM by MickD »
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Linq to XML Selection issue.
« Reply #11 on: January 03, 2014, 02:04:52 AM »
Thanks Mick.

The xml generator is currently using  writer.WriteElementString(key, value) which forces the value to be a quoted string.
which gives me
<title>"Value"</title>

I'll probably change it to a 3 step process per Element
writer.WriteStartElement("title");
writer.WriteString("Value");
writer.WriteEndElement();

which will give me something like
<title>Value</title>

... or I may write the data as Attributes, haven't decided yet.

I'm learning this stuff so I'm just concentrating on getting ducks in a row.

The ultimate goal is to read the data files, translate to XML for perusing in a dataGridView and possible edits then write back to the original format. The XML is really just a means to an end rather than the finished product.

Because of this I have the option to change the interim data format as I see fit.

kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

fixo

  • Guest
Re: Linq to XML Selection issue.
« Reply #12 on: January 03, 2014, 05:38:21 AM »
This little code snip is working on my end:
Code: [Select]
         XElement root = XElement.Load(@"C:\Test\STL.xml");
       
            var items = (from n in root.Descendants("mbr_con").Elements("con_id") select n.Name + "=" + n.Value).ToArray();
            foreach (var a in items)
                Console.WriteLine(a);

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Linq to XML Selection issue.
« Reply #13 on: January 03, 2014, 06:06:43 AM »
Thanks Oleg.
That is an interesting variation !
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

MexicanCustard

  • Swamp Rat
  • Posts: 705
Re: Linq to XML Selection issue.
« Reply #14 on: January 03, 2014, 07:33:12 AM »
If you know the XML format and its always the same, why not Serialize it?  That would be a lot easier than looping through writing/reading every value.
Revit 2019, AMEP 2019 64bit Win 10