Click or drag to resize

XmlSchemaExportT Class

Abstract class for strict schema based XML file exports. Implements some basic magic that can be used. Works perfectly with files generated from XSD The type of (generated) schema object
Inheritance Hierarchy
SystemObject
  ExportImportBase
    Severa.APIXmlSchemaExportT
      Severa.APIXmlSchemaInvoiceExportT

Namespace: Severa.API
Assembly: Severa.SOAP.API (in Severa.SOAP.API.dll) Version: 1.0.0
Syntax
public abstract class XmlSchemaExport<T> : ExportImportBase

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "T:Severa.API.XmlSchemaExport`1"]

The XmlSchemaExportT type exposes the following members.

Constructors
 NameDescription
Protected methodXmlSchemaExportTInitializes a new instance of the XmlSchemaExportT class
Top
Methods
 NameDescription
Protected methodExport Exports the object to XML
Protected methodFixOversizedStrings Before serializing your object to XML, all of its string fields are modified to fit. Essentially truncated. This modifies your exported object straight. This includes also string lists. The detection is based on the generated class, you need to have it add the StringLengthAttribute annotations to the fields. Only maximum string lengths are checked against, the minimums are left alone.
Protected methodGetXmlReaderSchemaResolver Where are your schemas at? Also DTDs, all that stuff
Protected methodGetXmlReaderSettings Gets settings for the XML reader that is used in validating the import/export XML
Protected methodGetXmlWriter You can override the default XmlWriter implementation by overriding this and providing your own writer instance
Protected methodGetXmlWriterSettings You preferred settings for exporting the object to XML. Important, such as the encoding
Protected methodOnPostWrite Gives you an access to the stream AFTER the object was serialized to the stream
Protected methodOnPreWrite Gives you an access to the stream BEFORE the object is serialized to the stream
Protected methodPopulateXmlReaderSchemas Add your schemas to the schema set. To be be used in validation. By default we do follow the schemas declared in the XML
Protected methodProcessStringLengthConstraints Checks all filled fields that they conform to the structure. The max string lengths only. Trims the strings from the end if they are too big for the field. You can call this after you have populated your model
Public methodStatic memberToXmlDateTime Makes sure date time is converted as valid XML dateTime. This is a well know problem in .Net XML serialization business. This is maybe the easiest fix but rather manual as well. When you know that a type is dateTime in XML, you should pass the date through this. This will strip the parts of second from the date to avoid them to be written.
Public methodValidate 
Top
See Also