Select to view content in your preferred language

Serialize a FeatureClass?

1306
4
04-13-2010 12:44 PM
KeithGemeinhart
Regular Contributor
I've searched everywhere and can't find any information on how to do it other than saying you can't use IXMLSerializer on IFeatureClass because it doesn't implement ISerializable.

So ... how can I serialize an IFeatureClass object to XML?

Thanks!
-Keith
0 Kudos
4 Replies
JamesMacKay
Deactivated User
Keith,

This article shows how to export a feature class to XML as part of an XML workspace document:

http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/how_to_export_a_dataset...

Cheers,
James
0 Kudos
KeithGemeinhart
Regular Contributor
Thanks for the link. However, this particular feature class that I'm interested in doesn't exist in a geodatabase. It was created in code and I want to save it as XML. IWorkspace is null.
0 Kudos
KirkKuykendall
Deactivated User
Perhaps use the RecordSet class.  It implements IXmlSerialize, but I've never tried it.  Create a new empty recordset, then use IRecordSetInit.Insert to insert features.
0 Kudos
KeithGemeinhart
Regular Contributor
I finally figured this out. I posted an answer on stackoverflow.com. Feedback on my approach is welcome and encouraged.

http://stackoverflow.com/questions/2767967/
0 Kudos