Click here to Skip to main content
15,039,149 members
Please Sign up or sign in to vote.
3.22/5 (3 votes)
See more:
hi
could you help me reading XML file using vb.net
my XML file looks like :
XML
<This is SAHR Document created on:>
07/05/2013 01:41:25 ص
<Dots>
<New_Dot>
 <X_coordinate>59</X_coordinate>
 <Y_coordinate>61</Y_coordinate>
 <layer>0</layer>
</New_Dot>
</Dots>



i want to retrive the value of X_coordinate in a variable and so the value of Y_coordinate and layer
if any one has an idea please help .
Posted

1 solution

You have everything you need in .NET FCL. This is my short overview of the ways to parse XML:


  1. Use System.Xml.XmlDocument class. It implements DOM interface; this way is the easiest and good enough if the size if the document is not too big.
    See http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx[^].
  2. Use the class System.Xml.XmlTextReader; this is the fastest way of reading, especially is you need to skip some data.
    See http://msdn.microsoft.com/en-us/library/system.xml.xmlreader.aspx[^].
  3. Use the class System.Xml.Linq.XDocument; this is the most adequate way similar to that of XmlDocument, supporting LINQ to XML Programming.
    See http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx[^], http://msdn.microsoft.com/en-us/library/bb387063.aspx[^].


—SA
   
Comments
Kenneth Haugland 7-May-13 14:58pm
   
Oh yes, 5'ed. :-)
   
Thank you, Kenneth.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900