XML Edit/Save

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~
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top