Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parsing XML
Message
De
19/12/2014 15:32:09
 
 
À
19/12/2014 12:00:53
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Versions des environnements
Environment:
C# 5.0
OS:
Windows Server 2008
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01612438
Message ID:
01612454
Vues:
52
>I have to download some lists of codes and descriptions in XML format from a webservice and compare them with a list I'll be getting from SQL.
>Then insert or amend codes back to the web service.
>
>Any thoughts on the best way to split up xml in c# and run a process like that
>
>Thanks

For XML handling I would use the XElement class (http://msdn.microsoft.com/en-us/library/system.xml.linq.xelement%28v=vs.110%29.aspx). You can find an example of its use at http://www.mssqltips.com/sqlservertip/1524/reading-xml-documents-using-linq-to-xml/. For querying your received XML, use Load or Parse methods to read it into a XElement, and use the Descendents, Element, Elements, Attribute, or Attributes methods and the Value property to read the data. To construct your response use the XElement constructor to create the elements and the Add method to add child elements to the hierarchy.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform