Select to view content in your preferred language

Beta 10 SDK: Error creating ESRI.ArcGIS.Catalog.ExportXML object

526
3
06-03-2010 07:43 AM
JoseGarcia
Emerging Contributor
Hi

Creating a ESRI.ArcGIS.Catalog.ExportXML object in ArcObjects Beta 10 SDK I'm getting the next error:

[INDENT]Retrieving the COM class factory for component with CLSID {D3579939-F8FD-4574-87BD-8E97E81055BE} failed due to the following error: 80040154.[/INDENT]

Dim metadataExport As IMetadataExport
metadataExport = New ExportXML  <-- FAIL LINE
metadataExport.Export(...)

Same code work for 9.X versions. I checked the solution in (http://forums.esri.com/thread.asp?t=219248&f=1707&c=159) about configuring destination CPU to x86, but no success.

Any help about the problem?

Thanks and regards,
Jose Garcia
0 Kudos
3 Replies
LuisBerrocal
New Contributor
I´m having the same problem using ArcObjects 10 SP2. It seems ESRI eliminated the ESRI.ArcGIS.Catalog.ExportXML class.

I cannot find a similar class to replace. If any one has any ideas I would appreciate the input.
0 Kudos
WaiChan1
Deactivated User
Same problem here. I have codes in 9.3 with ExportXML object, but couldn't find a replacement object in 10.0. Does anyone else encounter the same problem but found a solution? Any feedback is greatly appreciated.
0 Kudos
victorruiz
Deactivated User
Hi

I'm testing this custom class to export metadata using ArcGIS 10.1

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ESRI.ArcGIS.Catalog;
using ESRI.ArcGIS.Geodatabase;

//' Copyright 2008 ESRI
//'
//' All rights reserved under the copyright laws of the United States
//' and applicable international laws, treaties, and conventions.
//'
//' You may freely redistribute and use this sample code, with or
//' without modification, provided you include the original copyright
//' notice and use restrictions.
//'
//' See use restrictions at <your ArcGIS install location>/developerkit/userestrictions.txt.


namespace CopyFiles
{
    class ExporterXML:  ESRI.ArcGIS.Catalog.IMetadataExport
    {

    public string  DefaultFilename{
 
    //   'in the Export Metadata dialog box...
    //   'if you select a file first and then choose this exporter from the
    //   'Format dropdown list, this file extension replaces the original
    //   'one that you see at the end of the path in the Location text box
    //   'if you choose this exporter first then click Browse, this filename
    //   'is the default file name, and this file extension is used as
    //   'the default filter for listing files

get { return "template.xml"; }
}

public void  Export(ESRI.ArcGIS.Geodatabase.IMetadata source, string destination)
{
    IXmlPropertySet pXPS;
    string vValues;
    string sService;
    string sServe;
    string sTitle;
 
    //'1. get metadata from the source GxObject
   
    //'The IMetadata.Metadata property returns an XmlPropertySet object; if
    //'   metadata doesn't exist, ArcCatalog creates and initializes a new
    //'   XmlPropertySet object for you. If metadata doesn't exist, don't export.
    pXPS = (IXmlPropertySet)source.Metadata;
   
    if (pXPS.IsNew)
        return ;
   
    //'2. apply stylesheet to generate output XML
   
    //'This exporter uses the XSLT stylesheet provided with the sample to modify the
    //'   metadata and copy the output to a new XML file. XSLT removes all synchronized
    //'   information, removes FGDC hints, removes thumbnail and enclosures, and then
    //'   removes any empty container elements left over after the leaf nodes have been
    //'   removed. Leaves in empty elements that have a value attribute that contains
    //'   text - used in ISO to store values for some elements.
    //'
    //'If no path specified for xslPath parameter,
    //'   the XSLT stylesheet must reside in ArcGIS bin directory. If it resides elsewhere,
    //'   set the appropriate path below and recompile. If it resides in
    //'   %ARCHOME\Metadata\Stylesheets, add an underscore (_) to the beginning of filename
    //'   so it won't appear in dropdown lists in ArcCatalog, modify path below and
    //'   recompile. outputANSI parameter must be FALSE and header must be NULL for this to
    //'   work. XSLT stylesheet adds the XML processing instruction and DOCTYPE comment.
   
    //'    pXPS.SaveAsFile "exportDocumentation.xsl", vbNullString, False, destination
    //pXPS.SaveAsFile("D:\\ArcGIS2FGDC.xsl","", false, destination);
    pXPS.SaveAsFile("C:\\Program Files (x86)\\ArcGIS\\Desktop10.1\\Metadata\\Stylesheets\\ArcGIS_ItemDescription.xsl", "", false, destination);
   
 
}

public string  Name
{
get {  
       // 'this is the name that appears in the Format dropdown list in the
       // 'Export Metadata dialog box
      return "Template Exporter";
    }
}
}
}



And try to make a QI like this


string strName;
                    strName = pGxObj1.Name;
                   
                    pMD = (IMetadata)pGxObj1;
                   // IMetadataExport a;


                    m_pExporterXML = new ExporterXML();
                    pExport = m_pExporterXML;
                   
                    //'Export the metadata to a local directory
                    pExport.Export( pMD, "D:\\" + strName + ".html");
                   
                      pGxObj1 = pEnumGxObj.Next();
                    intCount = intCount + 1;

Works when  I use ArcGIS_ItemDescription.xsl but Now what I want is to export metadata but using FGDC standar.
but it crash when I use ARCGIS2FGDC.xml located on C:\Program Files (x86)\ArcGIS\Desktop10.1\Metadata\Translator.

I think I must use python to get this FGDC format and use ExportMetadata_conversion

import arcpy
from arcpy import env
env.workspace = "C:/data"
#set local variables
dir = arcpy.GetInstallInfo("desktop")["InstallDir"]
translator = dir + "Metadata/Translator/ESRI_ISO2ISO19139.xml"
arcpy.ExportMetadata_conversion ("data.gdb/roads", translator,
    "roads_19139.xml")


so then what is the diference between ExportMetadata_conversion on python and pXPS.SaveAsFile on arcobjects.

I'm a Little confused

Thanks for read.
0 Kudos