SK_XmlDocumentLoadFile Function

Loads an XML document from a file or registry value.

Remarks

Important Note

The XML document returned in the xml parameter must be freed from memory! The SK_XmlDocumentDispose function is recommended for this purpose.

Syntax

C/C++
SK_ResultCode SK_XmlDocumentLoadFile(int flags, const char *path, SK_XmlDoc *xml);
Visual Basic
Declare Function SK_XmlDocumentLoadFile(ByVal flags As Long, ByVal path As String, ByRef xml As Long) As Long

Arguments

flags
Any flags passed into this function-call.
path
The absolute path to a file or registry value.
xml
Reference/pointer to a SK_XmlDoc handle, which will point to the XML document handle when the call succeeds. The handle must be initialized to NULL (0) prior to calling this function.

Returns

All possible return values are included in the SK_ResultCode enumeration. Return codes to expect include:

Result Code Description
SK_ResultCode.SK_ERROR_NONE No error.
SK_ResultCode.SK_ERROR_XML_PARSER_FAILED The XML parser encountered an error.
SK_ResultCode.SK_ERROR_INVALID_ARGUMENTS Some or all of the arguments are invalid.
SK_ResultCode.SK_ERROR_COULD_NOT_OPEN_FILE An attempt to open a file failed.
SK_ResultCode.SK_ERROR_COULD_NOT_READ_FILE An attempt to read a file failed.
SK_ResultCode.SK_ERROR_COULD_NOT_OPEN_REGISTRY_KEY An attempt to open a registry key failed.
SK_ResultCode.SK_ERROR_COULD_NOT_READ_REGISTRY_KEY An attempt to read a registry key value failed.
SK_ResultCode.SK_ERROR_IO_OPERATION_FAILED An attempt to perform an I/O operation failed.
SK_ResultCode.SK_ERROR_MEMORY_ALLOCATION Memory could not be allocated.