[Saxdotnet-devel] Replace is-standalone feature with ILocator member
Brought to you by:
jeffrafter,
kwaclaw
From: Karl W. <ka...@wa...> - 2004-12-09 01:29:09
|
It seems quite unnatural to report the standalone flag in the XML declaration through a parser feature. If anything, it should have been a property. We propose to remove the is-standalone feature and add a new property - let's call it "EntityType" - to the ILocator interface, whose type is defined like this (copied from the source, incl. doc comments): /// <summary>Describes the kind of entity that is being parsed.</summary> /// <remarks>For document entities, the *declared* rather than the effective /// value of the standalone flag is reported.</remarks> public enum ParsedEntityType { /// <summary>Document entity without specified value for the standalone flag.</summary> Document, /// <summary>Document entity with standalone="no".</summary> NotStandalone, /// <summary>Document entity with standalone="yes".</summary> Standalone, /// <summary>External general entity.</summary> General, /// <summary>External parameter entity.</summary> Parameter } This enumerated type covers more than just the standalone flag, but does it in a way so that the standalone flag is mutually exclusive with external entities. ILocator would then look like this (incl ILocator2 methods): public interface ILocator { string PublicId { get; } string SystemId { get; } int LineNumber { get; } int ColumnNumber { get; } string XmlVersion { get; } string Encoding { get; } ParsedEntityType EntityType { get; } } Karl |