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
How will you implement Page Fragment Caching? The Page fragment caching includes the caching of a fragment of the page, rather than the whole page. When the parts of the page a

Show the code for the file dependency in cache? Partial Class Default_aspx Public Sub displayAnnouncement() Dim announcement As String If Cache("announcement") Is Noth

ASP Developer- We are needed to hire an ASP developer for some urgent work. He needs to add a new page to an already prepared site; the page is already completed in HTML. He jus

What are different types of caching using in ASP.NET? You can use 2 types of output caching to cache information which is to be transmitted to and displayed in a Web browser:

Project Description: We're seeking an IT candidate with experience to help us optimizely,  Skills required: .NET, C# Programming, ASP, eCommerce, SQL

In what order do the events of an ASPX page execute. As a developer is it important to understand these events?   If you try to access it in Page_Load that is way previous than

Project Description: I am seeking a serious and motivated software developer that can create for me software like scanspeeder with all the functions as it has. Only thing that I

Web Application and Web Service For this part of the assignment, you are to develop a web application and web service using technologies and techniques taught in this subject

Find out the Factorial - C# Program I've been trying so many codes for this but those codes didn't work well. Please write the code for find out the factorial of an integer nu

Finding the frequencies - C# Program: Please let me know how to find Frequencies in C#.