_DictionaryXMLTransforms::GetXMLFromFile Method [C++]

Use this method to generate a XML Document Object Model (DOM) document from the specified file.

Definition

[C++]

HRESULT _DictionaryXMLTransforms::GetXMLFromFile(BSTRsFileName,
  IXMLDOMDocument**RetValue);

[Visual Basic]

Function GetXMLFromFile(sFileName As String) As Object

Parameters

  • sFileName[C++]
    [in] A BSTR that contains the name of the file to convert.
  • sFileName[Visual Basic]
    A String that contains the name of the file to convert.
  • RetValue[C++]
    [out, retval] A pointer to hold the reference to the returned IXMLDOMDocument interface of the XMLDOMDocument object, which will contain the converted file data.

Return Values

[C++] This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.

[Visual Basic] If this method completes successfully, it returns an object reference to an XMLDOMDocument object containing the converted file data.

Error Values

This method does not return an error when the file specified by sFileName is an .exe file, a text file, an invalid XML file, or a non-existent file. The error type can only be found by viewing the ParseError property of the DOMDocument object.

Remarks

[C++] The RetValue parameter contains valid data only if the method completes successfully.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

[Visual Basic]

Example

' oDictionaryXMLTransforms is a Commerce.DictionaryXMLTransforms object
' dDict is a Dictionary object; sMyFileName.xml is a string
' oXMLDOMDocument is a XMLDOMDocument object
oXMLDOMDocument = _
    oDictionaryXMLTransforms.GetXMLFromFile("sMyFileName.xml")

See Also

[C++]DictionaryXMLTransforms Object

[Visual Basic]DictionaryXMLTransforms Object

Copyright © 2005 Microsoft Corporation.
All rights reserved.