Métricas do repositório
- Stars
- (17.886 stars)
- Métricas de merge de PR
- (Mesclagem média 12d 11h) (661 fundiu PRs em 30d)
Description
Background and Motivation
XmlTextReader exposes the Normalization property, by default false, which affects whitespace and attribute value handling. No such property is exposed on XmlReader even though it is internally available on XmlTextReaderImpl where it is effectively hard-coded to true. If the developer wishes to move to the newer API, to be able to specify XmlReaderSettings for example, they have no choice but also change whitespace and attribute value handling, which may not be desirable.
Proposed API
Technically the following should work but it may as well be a new property on XmlReaderSettings.
namespace System.Xml
{
public abstract class XmlReader : IDisposable {
+ public virtual bool Normalization { get; set; }
}
}
Usage Examples
See https://github.com/dotnet/msbuild/pull/6232 for an example. The change would make XML parsing in MSBuild significantly faster if the property proposed here was available. In the PR XmlTextReaderImpl.Normalization is called via reflection as a proof of the concept.
Alternative Designs
Unaware of alternative approaches other than implementing our own XML parser.
Risks
N/A