The Class Factory

The class factory is a module value.  All the data types specified by the schemas added to a validating XML Processor are subtended underneath it.  You need never be aware of these data types as they are maintained by the schema cache.  The module values in the cache are destroyed when the cache is destroyed (and there are no instances of the types remaining).  It is, therefore, recommended that a new class factory be used for each XML Processor.

Inside the class factory are the factory types themselves, organized into namespaces.  For example, if there are two namespaces, there will be two objects, each subtending the data types for each namespace.

Because all type modules are children of namespaces, these modules can be traced back to the namespace and its type. The XMLWrite statement makes use of this when it determines the namespace prefixes to be added.

See also: MakeTypeInstance, a function that creates an object of the specified module intended for use when instantiating XML data types from a class factory.