0

I have a question - how come there is XPathReader in C# but not in VB.NET? Or is it that I simply haven't done enough research to find it out? Because I've been looking it up quite a bit and I came up with two questions

  1. LINQ to XML. I was wondering if this loads the entire document. Because I think it does. I want to avoid this. I don't want to read the whole document in memory.

  2. XPathReader - Why can't I find it for VB.NET?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
user2417731
  • 179
  • 3
  • 14
  • What do you mean, "you can't find it for VB.NET?" What did you try and what was the result? – John Saunders Jul 18 '13 at 17:30
  • I added XPathReader in my VB.NET project. It wasn't giving any import suggestions - so I imported the stuff manually that was imported in the C# example. Still nothing. I then googled it and saw no examples for XPathReader for VB.NET, only for C#. – user2417731 Jul 18 '13 at 17:34
  • Again, what do you mean "still nothing"? Was there a compilation error? – John Saunders Jul 18 '13 at 17:37
  • See http://stackoverflow.com/questions/465237/what-ever-happened-to-xpathreader – John Saunders Jul 18 '13 at 17:38
  • I did read that but obviously I misunderstood it completely. Thank you. However, can anyone answer my first question? Does LINQ to XML load the whole document? And would XPathReader be faster? – user2417731 Jul 18 '13 at 17:51
  • XPathReader is not part of .NET. Are you thinking of [XPathDocument](http://msdn.microsoft.com/en-us/library/system.xml.xpath.xpathdocument.aspx)? – John Saunders Jul 18 '13 at 18:03
  • XPathReader is something someone from Microsoft made, I guess. But I was wondering if LINQ to XML is faster than XPathReader. I am looking for the fastest way to grab elements from a large XML file basically – user2417731 Jul 18 '13 at 18:46
  • The fastest way is to try it and find out. XML processing may not even be the slow part of the application. – John Saunders Jul 18 '13 at 18:59
  • Well what I am doing is that I am inserting rows into a datatable and I am getting values of an xml node through it's parent node. Which I posted here http://stackoverflow.com/questions/17727951/vb-net-for-loop-too-slow-when-grabbing-xml. Anyway, it seems that doing it for 600 nodes becomes pretty slow and takes 2 seconds. – user2417731 Jul 18 '13 at 19:04

0 Answers0