Creates a new XML text reader. It creates an XmlTextReader - CSharp System.Xml

CSharp examples for System.Xml:XML Reader

Description

Creates a new XML text reader. It creates an XmlTextReader

Demo Code

// Copyright (c)2014 Solutions Design. All rights reserved.
using System.Xml;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;/*from   w w w.j a v a 2 s.  co  m*/

public class Main{
        /// <summary>
      /// Creates a new XML text reader. It creates an XmlTextReader, as the XmlReader.Create() routine creates always a normalizing reader which always converts
      /// CRLFs into \n.
      /// </summary>
      /// <param name="filename">The filename.</param>
      /// <returns>
      /// ready to use xmlreader. This reader is in its initial state
      /// </returns>
      public static XmlReader CreateXmlReader(string filename)
      {
         return new XmlTextReader(filename) { WhitespaceHandling = WhitespaceHandling.None };
      }
}

Related Tutorials