Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Summarize values from subnodes
Message
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
XML
Titre:
Summarize values from subnodes
Versions des environnements
Environment:
C# 5.0
OS:
Windows 10
Network:
Windows Server 2012
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01634648
Message ID:
01634648
Vues:
53
Hello,
I have this xml file:
<?xml version="1.0" encoding="UTF-8"?>
<ITX_CLOSE_EXPORT>
  <STORE_INFO>
    <storeId>27021</storeId>
  </STORE_INFO>
  <VALID_TICKETS>
    <TICKET lRetailStoreId="27021" lWorkstationNmbr="1" lTaNmbr="100326">
      <lRetailStoreID>27021</lRetailStoreID>
      <dTotalNet>16.9000</dTotalNet>
    </TICKET>
    <TICKET lRetailStoreId="27021" lWorkstationNmbr="1" lTaNmbr="100327">
      <lRetailStoreID>27021</lRetailStoreID>
      <dTotalNet>20.9000</dTotalNet>

etc.
I am trying to summarize the values of "dTotalNet", but have trouble getting the list of subnodes "Ticket".
string xpath = "ITX_CLOSE_EXPORT/VALID_TICKETS";
var nodes = xmlDoc.SelectNodes(xpath);
that gives only one node which I can't get any more information from.
string xpath = "ITX_CLOSE_EXPORT/VALID_TICKETS/TICKET";
var nodes = xmlDoc.SelectNodes(xpath);
That gives 0 result. What am I doing wrong?
Christian Isberner
Software Consultant
Répondre
Fil
Voir

Click here to load this message in the networking platform