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
Print Triangle in Reverse Pattern - C# Program Need the code of C# Program for Print Triangle in Reverse Pattern.

How object pooling in .NET is done COM+ reduces overhead by creating object from scratch. Thus  in COM+ when object is activated its activated from pool and when its deactivate

What are the best practices while implementing globalization and localization? The best methods while developing international language support software are shown below:- 1)

I want help to make Clone a Website -dior.com I want all features of above mentioned site 1)Effects 2)Mobile optimization for mobile browsers of all smart phones. Etc.

What I need is the following: I need an implementation in matlab under windows to open a named pipe and to read data from the pipe (an other program writes into the pipe) in quasi

Inventory billing and Management application in .net Project Description: Digital Inventory management Main Features         Multi user User friendly windows based s

Hi, I have been working on Dot Net over the past few years. I would like to do online tutoring for .NET. Could you please let me know the possible oppurtunities

The Performance of the viewstate varies depending on the type of server control to which it is applied. The Text Box, Label,   RadioButton,CheckBox, and HyperLink are server contro

What is CTS and CLS? => CLS stands for common language specification where as CTS stands for common type system. => CLS : cls is a standard for .net . cls is small set of sp

We need Long term Kentico developer needed I want a solid Kentico developer that I can rely on to handle overflow work. Usually this will include about 5 hours of work each week