Class FeatureCatalogueReader
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
streamStreamStream 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
nameorversionNumber; thenameorcodeof an attribute, role, association or type (plus a simple attribute'svalueType, or a listed value'slabelandcode); or a binding'smultiplicity(with itsS100Base:lower) or therefof itsattribute,association,role,featureTypeorinformationTypereference. The message names the missing element or attribute and, where there is one, thecodeof the enclosing catalogue entry.- FormatException
A multiplicity's
S100Base:loweris not an integer.
Read(string)
Reads a Feature Catalogue from an XML file.
public static FeatureCatalogue Read(string path)
Parameters
pathstringPath (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
nameorversionNumber; thenameorcodeof an attribute, role, association or type (plus a simple attribute'svalueType, or a listed value'slabelandcode); or a binding'smultiplicity(with itsS100Base:lower) or therefof itsattribute,association,role,featureTypeorinformationTypereference. The message names the missing element or attribute and, where there is one, thecodeof the enclosing catalogue entry.- FormatException
A multiplicity's
S100Base:loweris not an integer.- IOException
The file cannot be opened or read (e.g. FileNotFoundException).