Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/09/10 11:14:37 (14 years ago)
Author:
epitzer
Message:

Replace XML reader to ensure proper parsing of line endings especially inside CDATA blocks (#548)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlParser.cs

    r3028 r3293  
    1818  public class XmlParser : IEnumerable<ISerializationToken> {
    1919
    20     private readonly XmlReader reader;
     20    private readonly XmlTextReader reader;
    2121    private delegate IEnumerator<ISerializationToken> Handler();
    2222    private readonly Dictionary<string, Handler> handlers;
     
    2727    /// <param name="input">The input.</param>
    2828    public XmlParser(TextReader input) {
    29       XmlReaderSettings settings = new XmlReaderSettings {
    30         ConformanceLevel = ConformanceLevel.Document,
    31         IgnoreWhitespace = true,
    32         IgnoreComments = true
    33       };
    34       reader = XmlReader.Create(input, settings);
     29      reader = new XmlTextReader(input);
     30      reader.WhitespaceHandling = WhitespaceHandling.All;
     31      reader.Normalization = false;
    3532      handlers = new Dictionary<string, Handler> {
    3633                     {XmlStringConstants.PRIMITIVE, ParsePrimitive},
Note: See TracChangeset for help on using the changeset viewer.