G
Gina_Marano
Hey All,
I need to edit an existing XML file and save it. It seem pretty easy
and straight forward but it fails because (I assume) the xml document
lists a schema location that I do not have access to.
My code: (testing purposes)
xmlDocument doc = new XmlDocument();
doc.Load(@"C:\Documents and Settings\Gina\Desktop\test1.xml");
XmlNodeList nodeList = doc.SelectNodes("//Order");
foreach (XmlNode node in nodeList)
richTextBox1.AppendText(node.Name+'\n');
But apparently since it can't find the schema I get zero nodes. (If I
remove the schemalocation line from the XML file that all is happy)
snipit from xml file:
<Order xmlns="http://www.abc.com/xml/Order"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.abc.com/xml/Order.xsd Order.xsd"
CustomerID="MyCust" orderDate="2006-11-13" OrderID="8704356">
For example I would like to change the OrderID.
Can I move forward without the validation?
If I can get a copy of the xsd can I put it locally on my machine and
have it use that instead?
~Gina~
I need to edit an existing XML file and save it. It seem pretty easy
and straight forward but it fails because (I assume) the xml document
lists a schema location that I do not have access to.
My code: (testing purposes)
xmlDocument doc = new XmlDocument();
doc.Load(@"C:\Documents and Settings\Gina\Desktop\test1.xml");
XmlNodeList nodeList = doc.SelectNodes("//Order");
foreach (XmlNode node in nodeList)
richTextBox1.AppendText(node.Name+'\n');
But apparently since it can't find the schema I get zero nodes. (If I
remove the schemalocation line from the XML file that all is happy)
snipit from xml file:
<Order xmlns="http://www.abc.com/xml/Order"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.abc.com/xml/Order.xsd Order.xsd"
CustomerID="MyCust" orderDate="2006-11-13" OrderID="8704356">
For example I would like to change the OrderID.
Can I move forward without the validation?
If I can get a copy of the xsd can I put it locally on my machine and
have it use that instead?
~Gina~