wwXML::LoadXML

This method loads an XML document into a Microsoft XMLDom object. The method returns an object reference to the XML object or NULL in the event of failure.

If the document contains parsing errors this method will fail. In this case NULL is returned and lError is set to True and cErrorMsg contains full error information about the error and its location.

o.LoadXML(vXML)

Return Value

XML document object or NULL

Parameters

vXML
XML input. This input can either be an XML string or an XMLDOMDocument object, which has a document loaded. The document is checked for validity.

llAsync
Optional - Default: False

llPreserveWhiteSpace
Optional - Default: False

Remarks

Async mode is set to False and PreserveWhiteSpace is set to True.

Example


o = CREATE("wwXML")

loXML = o.LoadXML (FileToStr("t.xml") )
IF o.lError
   wait window "Error: " + o.cErrorMsg
   RETURN .F. 
ENDIF

loDocRoot = loXML.DocumentElement
...


Alternate Syntax passing existing DOM object: oXML = CREATEOBJECT("Microsoft.XMLDom") ... o = CREATE("wwXML") loXML = o.LoadXML (oXML,FileToStr("t.xml") ) IF o.lError wait window "Error: " + o.cErrorMsg RETURN .F. ENDIF loDocRoot = loXML.DocumentElement

See also:

Class wwXML (High Level Methods) |

© West Wind Technologies, 1996-2024 • Updated: 01/19/09
Comment or report problem with topic