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 Custom Login Page for Sharepoint 2013 with Active Directory Project Description: I would like to prepare a webpart or an application for Sharepoint 2013 foundation.

What is a delegate? A delegate is similar to a class that is used for storing the reference to a method and invoking that method at runtime, as needed. A delegate can hold the

What is difference between SITP and UTP in testing? The Unit Test Plan (UTP) are completed at smallest unit level or stand alone mode. For example you have Customer and invoici

ILDASM When it comes to the understanding of the internals nothing can beat ILDASM. ILDASM  converts all the exe or dll into IL code. To run ILDASM you have to go to "C:\Progra

This assignment is about writing a C# application that creates a minimal student enrolment system. The application will display lists of papers and students. The user can enrol stu

Develop PC Cleaner Software Project Description: We are seeking experienced developer who can develop Registry Cleaner / PC Cleaner software for us. Software should be like c

What is event bubbling? The Server controls such as  DataList, Datagrid,  Repeater can have another child controls inside them. For example the DataGrid can have combo box ins

Converting temperature from Fahrenheit to Celsius - Program C# I am facing some problems in the code for Converting temperature from Fahrenheit to Celsius. Can anybody suggest

What is normalization & what are the types of normalization? Normalization is a set of rules that have been established to aid in the design of tables that are meant to be conn

Describe the EventLog class. The EventLog class is used to access the Windows event logs from Windows services. Using EventLog, you can also customize Windows event logs that r