Unable to Load XML
-
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
-
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
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[^]
-
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
What's the error message?
-
What's the error message?
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
-
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[^]
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