Table of Contents

Class FeatureCatalogueReader

Namespace
EncDotNet.S100.Features
Assembly
EncDotNet.S100.Features.dll

Parses S-100 Part 5 Feature Catalogue XML into a FeatureCatalogue. The S100FC, S100Base and S100CI namespace URIs are taken from the root element's declarations, so versioned namespaces (e.g. http://www.iho.int/S100FC/5.2) are accepted. Each parse emits an s100.featurecatalogue.parse tracing activity.

public static class FeatureCatalogueReader
Inheritance
FeatureCatalogueReader
Inherited Members

Methods

Read(Stream)

Reads a Feature Catalogue from an XML stream.

public static FeatureCatalogue Read(Stream stream)

Parameters

stream Stream

Stream positioned at the start of the catalogue XML. It is read to the end but not disposed.

Returns

FeatureCatalogue

The parsed catalogue.

Remarks

The document is not validated against the S-100 FC schema. Elements and attributes that the returned model declares non-nullable are checked for presence, so a catalogue that lacks one fails with an XmlException rather than yielding null in a non-nullable property. The catalogue's versionDate is lenient and reads as an empty string when absent. Optional elements that are absent yield null or empty collections.

Exceptions

XmlException

The XML is malformed or has no root element, or a required element or attribute is missing: the catalogue's name or versionNumber; the name or code of an attribute, role, association or type (plus a simple attribute's valueType, or a listed value's label and code); or a binding's multiplicity (with its S100Base:lower) or the ref of its attribute, association, role, featureType or informationType reference. The message names the missing element or attribute and, where there is one, the code of the enclosing catalogue entry.

FormatException

A multiplicity's S100Base:lower is not an integer.

Read(string)

Reads a Feature Catalogue from an XML file.

public static FeatureCatalogue Read(string path)

Parameters

path string

Path (or URI) of the catalogue XML file.

Returns

FeatureCatalogue

The parsed catalogue.

Remarks

The document is not validated against the S-100 FC schema. Elements and attributes that the returned model declares non-nullable are checked for presence, so a catalogue that lacks one fails with an XmlException rather than yielding null in a non-nullable property. The catalogue's versionDate is lenient and reads as an empty string when absent. Optional elements that are absent yield null or empty collections.

Exceptions

XmlException

The XML is malformed or has no root element, or a required element or attribute is missing: the catalogue's name or versionNumber; the name or code of an attribute, role, association or type (plus a simple attribute's valueType, or a listed value's label and code); or a binding's multiplicity (with its S100Base:lower) or the ref of its attribute, association, role, featureType or informationType reference. The message names the missing element or attribute and, where there is one, the code of the enclosing catalogue entry.

FormatException

A multiplicity's S100Base:lower is not an integer.

IOException

The file cannot be opened or read (e.g. FileNotFoundException).