MIXmlDocumentLoad() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Loads an XML document from the specified location.

Syntax

MIXmlDocumentLoad( ByVal hXMLDocument As MIXmlDocument, 
	ByVal strPath As String, pbParsingError As SmallInt, 
	ByVal bValidate As SmallInt, ByVal bResolveExternals As SmallInt )
	As SmallInt

hXMLDocument is the MIXmlDocument object handle.

strPath is a string containing the path/URL that specifies the location of the XML file.

pbParsingError is a reference to a SmallInt that indicates TRUE if the load succeeded; FALSE if the load failed.

bValidate is a SmallInt that indicates whether the parser should validate this document. If TRUE (1), it validates during parsing. If FALSE (0), it parses only for well-formed XML.

bResolveExternals is a SmallInt that indicates whether external definitions, resolvable namespaces, document type definition (DTD) external subsets, and external entity references, are to be resolved at parse time, independent of validation. When the bResolveExternals parameter is TRUE (1), external definitions are resolved at parse time. This allows default attributes and data types to be defined on elements from the schema and allows use of the DTD as a file inclusion mechanism. This setting is independent of whether validation is to be performed, as indicated by the value of the bValidate property. If externals cannot be resolved during validation, a validation error occurs. When the value of bResolveExternals is FALSE (0), externals are not resolved and validation is not performed.

Return Value

Nonzero if successful, otherwise 0. To determine the cause of the failure, call the MIGetErrorMessage() function.

Description

If the URL cannot be resolved or accessed or does not reference an XML document, this method returns FALSE. Calling MIXmlDocumentLoad() on an existing document immediately discards the content of the document. If loading an XML document from a resource, the load must be performed asynchronously or the load will fail.