XmlCreateDocumentFromFile Function

Action

Loads an XML document from a file. You have to pass the absolute filename. If you want to load XML documents from files in the data section, use GetDataFilePath to get the absolute filename.

Include file

XmlAPI.bdh

Syntax

XmlCreateDocumentFromFile( in sFilename : string ): number;

Return value

  • document handle if successful

  • 0 otherwise

Parameter Description
sFilename Filename of the XML file that should be loaded!

Example

dcltrans
  transaction TMain
  var
hDocument, hOrderItem : number;
sAttrValue            : string;
  begin
    hDocument := XmlCreateDocumentFromFile("C:\\MyXMLDocuments\\Order.xml");
    hOrderItem := XmlSelectSingleNode(hDocument, "//OrderItem[1]");
    XmlGetAttributeByName(hOrderItem, "price", sAttrValue);
  end TMain;