Differences
When porting the SAX Java interfaces to C#, several design decisions were
made to better support the language and environment. In addition extensions
were made to the SAX package, such as sample projects and a collection of
components that can be used directly in the designer.
Changes
All changes to the interfaces are clearly noted in the documentation.
These changes include:
- SAX core and extension interfaces merged/unified
- Character case and Naming (includes uppercase function names and "I"
prepended to interface names)
- Get/Set methods for properties replaced by generic IProperty<T>
interface, OnPropertyChange delegate type for implementation
- Strict EndDocument() call requirements
- SAX extension properties "declaration-handler" and "lexical-handler"
replaced by actual IXmlReader properties
- InputSource<S> generic class (will not close the
underlying source of type S)
- InputSource stores SystemId as URI
- IErrorHandler: ParseError instead of SaxParseException, also support
for ErrorId
- SaxNotSupportedException and SaxNotRecognizedException removed in
favour of standard .NET exception classes
- Attributes: IAttribute.GetValue(xxx) throws exception
- Attributes2: no IAttribute.IsDeclared(), instead we use new return
value "UNDECLARED" for GetType()
- AttributesImpl adds Capacity and StrBuilder properties
- Locator: added the ILocator.EntityType property - this makes the
"is-standalone" feature redundant
Extensions
In addition to the API changes, a number of extensions were added to the
C# version of the interfaces and classes. These extensions include:
- Consts/Constants
- Resources
- SaxReaderFactory (Removed XMLReaderFactory)
- Support for pausing and resuming ("reader-control" feature)
- Xml.Namespaces (removed NamespaceSupport and related)
- QName type (C# struct)