ArcObjects Library Reference (GeoDatabase)  

IXmlPropertySet.SaveAsFile Method

Transforms the metadata using an XSL stylesheet if specified, writes out the header if specified, and saves it in a file.

[Visual Basic .NET]
Public Sub SaveAsFile ( _
    ByVal xslPath As String, _
    ByVal header As String, _
    ByVal outputANSI As Boolean, _
    ByRef outPath As String _
)
[C#]
public void SaveAsFile (
    string xslPath,
    string header,
    bool outputANSI,
    ref string outPath
);
[C++]
HRESULT SaveAsFile(
  BSTR xslPath,
  BSTR header,
  VARIANT_BOOL outputANSI,
  BSTR* outPath
);
[C++]

Parameters

xslPath [in]   xslPath is a parameter of type BSTR header [in]   header is a parameter of type BSTR outputANSI [in]   outputANSI is a parameter of type VARIANT_BOOL outPath [in, out]   outPath is a parameter of type BSTR

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Errors Returned

A known bug exists that occurs when adding a header string. At times additional characters are added to the beginning of the saved file. The characters appear in HTML files, but do no affect viewing. The characters cause an error when viewing XML files. If these extra characters are found, XML files should be edited to remove the characters.

Remarks

The xslPath parameter is the path of the stylesheet to use when creating output. The stylesheet determines the type of file created by this method (examples are HTML and text files).

If included, the string header is placed before the root object. A placeholder (an empty string) is still necessary even if header is not included.

Unless the boolean parameter outputANSI is true the output file will be Unicode.  No differences are found between the two formats for XML, HTML, or Text documents. The outputANSI parameter is used for the FGDC utility MP which only supports ANSI.

The outPath defines the location for the files to be saved.  If a file already exists, it is overwritten.  A valid outPath string must be specified, otherwise output is not created.

 

See Also

IXmlPropertySet Interface