Xml text reader, DOT NET Programming

What is XML Text Reader?

The "XmlTextReader" class helps to give fast access to streams of XML data in a forward-only and read-only manner. The XMLTextReader also checks if the XML is well-formed. But the XMLTextReader does not validate against a schema or DTD for that you will need "XmlNodeReader" or "XmlValidatingReader" class.

The Instance of "XmlTextReader" can be created in number of ways. For e.g.  If you want to load a file from a disk you can use the below snippets.

XmlTextReader reader = new XmlTextReader(fileName);

To loop through all the nodes you require to call the "read ()" method of the "XmlTextreader" object. The "read()" method gives "true" if there are records in the XML document or else it returns "false".

//Open the stream

XmlTextReader reader = new XmlTextReader(file);

while (reader.Read())

{

// your logic goes here string pdata = reader.Value

 }

// Close the stream

reader.Close();

Posted Date: 9/25/2012 2:57:02 AM | Location : United States







Related Discussions:- Xml text reader, Assignment Help, Ask Question on Xml text reader, Get Answer, Expert's Help, Xml text reader Discussions

Write discussion on Xml text reader
Your posts are moderated
Related Questions
I need C# AAC sound receiver over WCF Project Description: I want a WCF method which is able to receive a byte stream of an AAC sound file from iPhone device and save it on t


What is a host process? A host process is an implementable program that hosts a workflow. It might be a Windows Forms application, a Web application, or a Web service applicati


Consuming a web service with SOAP on c# .NET Project Description: I need to consume a web service with SOAP. I have xml file and some description. I need it to be done

Importance of IT governance Governing and managing information technology is a crucial activity in organizations to generate business value. According to Ross & Weill (2004), f

What are major difference between classic ADO and ADO.NET? Following are some major differences among both In ADO we have recordset and in ADO.NET we have dataset. In rec

What is strong-typing versus weak-typing? Which is preferred? Why? Strong type is checking the types of variables as soon as possible, usually at compile time. While weak typing

I need a project which shows Paypal integration with ASP.net website We have events website written in C# and ASP.net. We want to integrate Paypal using API and have a full inte

what is the code for calculator in windowsapplication