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
  1. Home
  2. General Programming
  3. C#
  4. Unable to Load XML

Unable to Load XML

Scheduled Pinned Locked Moved C#
helpcsharpxmltutorial
5 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.
  • S Offline
    S Offline
    Samy Lahur
    wrote on last edited by
    #1

    Hi, I am new to XML and C#. I want to load this XML via the below code to an XmlDocument but it returns an Error which I don't know how to handle it. Here is the XML: Command completed successfully Epp1464 CrtContact0031 CrtContact0031-OLNIC-SRV 979170f7c148e945e352c7d155da8ac2 And here is my code. Actually I need also to know how to get the and node bvalue and attribue. try { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(strXMLSrc); } catch (Exception ex) { MessageBox.Show(ex.Message); } Please help. Samy -- modified at 8:35 Wednesday 11th January, 2006

    L K 2 Replies Last reply
    0
    • S Samy Lahur

      Hi, I am new to XML and C#. I want to load this XML via the below code to an XmlDocument but it returns an Error which I don't know how to handle it. Here is the XML: Command completed successfully Epp1464 CrtContact0031 CrtContact0031-OLNIC-SRV 979170f7c148e945e352c7d155da8ac2 And here is my code. Actually I need also to know how to get the and node bvalue and attribue. try { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(strXMLSrc); } catch (Exception ex) { MessageBox.Show(ex.Message); } Please help. Samy -- modified at 8:35 Wednesday 11th January, 2006

      L Offline
      L Offline
      lmoelleb
      wrote on last edited by
      #2

      Please always include the error - saves the rest of us from running it so see the problem. You are missing a namespace decleration for "contact". If you do not know how XML namespaces work, you can for example look here: http://www.w3schools.com/xml/xml_namespaces.asp[^]

      S 1 Reply Last reply
      0
      • S Samy Lahur

        Hi, I am new to XML and C#. I want to load this XML via the below code to an XmlDocument but it returns an Error which I don't know how to handle it. Here is the XML: Command completed successfully Epp1464 CrtContact0031 CrtContact0031-OLNIC-SRV 979170f7c148e945e352c7d155da8ac2 And here is my code. Actually I need also to know how to get the and node bvalue and attribue. try { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(strXMLSrc); } catch (Exception ex) { MessageBox.Show(ex.Message); } Please help. Samy -- modified at 8:35 Wednesday 11th January, 2006

        K Offline
        K Offline
        KaptinKrunch
        wrote on last edited by
        #3

        What's the error message?

        S 1 Reply Last reply
        0
        • K KaptinKrunch

          What's the error message?

          S Offline
          S Offline
          Samy Lahur
          wrote on last edited by
          #4

          Hi, I am so sorry. Here si the error. 'contact' is an undeclared namespace. Line 8, position 2. As It shows the namespace is not defined. But the XML is generated by a server and I can't change the strcuture. Therefore How can I bypass this error checking. Regards, Samy

          1 Reply Last reply
          0
          • L lmoelleb

            Please always include the error - saves the rest of us from running it so see the problem. You are missing a namespace decleration for "contact". If you do not know how XML namespaces work, you can for example look here: http://www.w3schools.com/xml/xml_namespaces.asp[^]

            S Offline
            S Offline
            Samy Lahur
            wrote on last edited by
            #5

            Hi, I am so sorry. Here si the error. 'contact' is an undeclared namespace. Line 8, position 2. As It shows the namespace is not defined. But the XML is generated by a server and I can't change the strcuture. Therefore How can I bypass this error checking. Regards, Samy

            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