# FdoXmlFeatureWriter Class Reference

`#include <FeatureWriter.h>`

Inheritance diagram for FdoXmlFeatureWriter:

[legend]

List of all members.

## Detailed Description

FdoXmlFeatureWriter writes features to an XML document. The features are written in GML format. Each feature is written in 3 steps:.

1. call SetClassDefintion() to define the feature's class name, schema name, and list of valid properties.
2. call SetProperty() for each feature property value to set.
3. call WriteFeature() to write the feature with the current property values. The feature's element name is derived from the class and schema name.

WriteFeature() ensures that the properties are written in their proper order. This may have slight performance implications since this writer has to accumulate the property values before writing them. If performance is a concern then FdoXmlFeaturePropertyWriter should be used instead.

Definition at line 46 of file FeatureWriter.h.

## Public Member Functions
FDO_API FdoXmlFeatureWriter * | GetAssociationWriter (FdoString *propertyName)
| Gets a reference to an FdoXmlFeatureWriter to write the data contained in an association property. If the property is not an association property, an exception is thrown.
FDO_API FdoClassDefinition * | GetClassDefinition ()
| Gets the class definition for the current feature being written.
FDO_API FdoXmlFeaturePropertyWriter * | GetFeaturePropertyWriter ()
| Gets the feature property writer that was passed to this object.
FDO_API FdoXmlFeatureWriter * | GetObjectWriter (FdoString *propertyName)
| Gets a reference to an FdoXmlFeatureWriter to write the data contained in a collection object property. If the property is not an object property, an exception is thrown.
FDO_API void | SetClassDefinition (FdoClassDefinition *classDefinition)
| Sets the class definition for the current feature being written.
FDO_API void | SetProperty (FdoPropertyValue *propertyValue)
| Sets a feature property.
virtual FDO_API void | WriteFeature (FdoString *elementTag=NULL)
| Writes the current feature to the XML document. If all features being written are of the same class then SetClassDefinition() can be called once and the WriteFeature() can be call repeatedly. In other words, the current class definition persists across WriteFeature() calls. Similarly, Property Values also persist across WriteFeature() calls. If the next feature to write has a property with different value from current feature, then SetProperty() must be called, to change the value, before next call to WriteFeature().
## Static Public Member Functions
static FDO_API FdoXmlFeatureWriter * | Create (FdoXmlWriter *writer, FdoXmlFeatureFlags *flags=NULL)
| Creates a Feature Writer for writing FDO features to XML.
static FDO_API FdoXmlFeatureWriter * | Create (FdoXmlFeaturePropertyWriter *writer, FdoXmlFeatureFlags *flags=NULL)
| Creates a Feature Writer for writing FDO features to XML.
## Protected Member Functions
void | _writeFeature (FdoString *elementTag, FdoClassDefinition *classDef, FdoPropertyValueCollection *propertyValues, FdoStringCollection *objectPropertyNames, FdoXmlFeatureWriterCollection *objectPropertyWriters, FdoStringCollection *associationPropertyNames, FdoXmlFeatureWriterCollection *associationPropertyWriters)
virtual void | Dispose ()
| Dispose this object.
| FdoXmlFeatureWriter (FdoXmlFeaturePropertyWriter *writer, FdoXmlFeatureFlags *flags)
| FdoXmlFeatureWriter ()
virtual | ~FdoXmlFeatureWriter ()
## Protected Attributes
FdoPtr< FdoStringCollection > | mAssociationPropertyNames
FdoPtr < FdoXmlFeatureWriterCollection > | mAssociationPropertyWriters
FdoPtr< FdoClassDefinition > | mClassDef
FdoPtr< FdoXmlFeatureFlags > | mFlags
FdoPtr< FdoStringCollection > | mObjectPropertyNames
FdoPtr < FdoXmlFeatureWriterCollection > | mObjectPropertyWriters
FdoPtr < FdoPropertyValueCollection > | mPropertyValues
FdoPtr < FdoXmlFeaturePropertyWriter > | mPropertyWriter

The documentation for this class was generated from the following file:

- FeatureWriter.h