Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. reading xml files with c#.Net

reading xml files with c#.Net

Scheduled Pinned Locked Moved C#
csharpxmlquestion
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    fady_sayegh
    wrote on last edited by
    #1

    hi to all, i'm coding a routing that can read all the node of an xml file. how can i know if a node has one or more child nodes best regards and thanks in advance fady

    D T 2 Replies Last reply
    0
    • F fady_sayegh

      hi to all, i'm coding a routing that can read all the node of an xml file. how can i know if a node has one or more child nodes best regards and thanks in advance fady

      D Offline
      D Offline
      Dustin Metzgar
      wrote on last edited by
      #2

      You could start by looking up System.Xml.XmlDocument.


      Logifusion[^]

      1 Reply Last reply
      0
      • F fady_sayegh

        hi to all, i'm coding a routing that can read all the node of an xml file. how can i know if a node has one or more child nodes best regards and thanks in advance fady

        T Offline
        T Offline
        Tamimi Code
        wrote on last edited by
        #3

        Try Dim ObjXmlDoc As New XmlDataDocument ObjXmlDoc.Load("file.xml") Dim objNodeList As XmlNodeList = ObjXmlDoc.GetElementsByTagName (strNodeName) Dim strValue As String = objNodeList(0).InnerText Catch ex As Exception ' whatever End Try Tamimi - Code

        F 1 Reply Last reply
        0
        • T Tamimi Code

          Try Dim ObjXmlDoc As New XmlDataDocument ObjXmlDoc.Load("file.xml") Dim objNodeList As XmlNodeList = ObjXmlDoc.GetElementsByTagName (strNodeName) Dim strValue As String = objNodeList(0).InnerText Catch ex As Exception ' whatever End Try Tamimi - Code

          F Offline
          F Offline
          fady_sayegh
          wrote on last edited by
          #4

          thanks to your reply, but my xml file is an XmlTextReader that has been loaded from an sql server database so do you have another solution for my problem best regards and thanks in advance fady

          D 1 Reply Last reply
          0
          • F fady_sayegh

            thanks to your reply, but my xml file is an XmlTextReader that has been loaded from an sql server database so do you have another solution for my problem best regards and thanks in advance fady

            D Offline
            D Offline
            Dustin Metzgar
            wrote on last edited by
            #5

            XmlTextReader xtr = ...
            XmlDocument doc = new XmlDocument();
            doc.Load(xtr);


            Logifusion[^]

            F 1 Reply Last reply
            0
            • D Dustin Metzgar

              XmlTextReader xtr = ...
              XmlDocument doc = new XmlDocument();
              doc.Load(xtr);


              Logifusion[^]

              F Offline
              F Offline
              fady_sayegh
              wrote on last edited by
              #6

              thanks to your reply, it works fine fady

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups