?
Solved

Properly loading XML Document

Posted on 2005-04-04
3
Medium Priority
?
233 Views
Last Modified: 2010-04-16
Is this the correct way to load an XML document and prepare it for usage?

I have an SDK that I interact with that takes valid XML and submits it to a database. It currently complains with
"found an error when parsing the provided XML text stream".

I know I’m missing something within these lines.


// LOAD XML
XmlDocument inputXMLDoc = new XmlDocument();
inputXMLDoc.Load("C:\\myXML.xml");
string input = inputXMLDoc.OuterXml;

// input should be ready to process?
process(input);
0
Comment
Question by:mhertzDEV
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 23

Accepted Solution

by:
b1xml2 earned 2000 total points
ID: 13698634
it appears something may be wrong with the xml document in itself.

and there's nothing wrong in your code... though,

XmlDocument doc = new XmlDocument();
doc.Load(@"c:\myXml.xml");
string xml = doc.InnerXml;

process(xml);
0
 
LVL 3

Expert Comment

by:sharpnet
ID: 13698755
depends on what you're trying to do with the XML?  Are you just trying to get at the XML structure, or data contained within the structure, or both?

Also, is the error occuring in the above code or is it occurring in the "process()" method?  If it's in the process method, what is that method trying to do?

Nick
0
 

Author Comment

by:mhertzDEV
ID: 13698787
Thanks ... b1xml2

There was something wrong with my XML doc.


Thank you!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question