Commands & Syntax > Commands > Xml Parser >

www.perfectkeyboard.com

 

File Open - < xml_file_open >() ... [Pro]

 

XML File Open
<xml_file_open>("File path",File handle variable,Root element handle variable,"Password")
Available in: Professional edition

This command opens an Xml file and parses it. If the file content is not valid Xml then the open command fails. The command returns file handle and root element handle (to variables passed as parameters) needed for other operarions.

 

#

Parameter name

Parameter description

1

File path

Xml file path.

2

File handle variable

Xml file handle - a unique number that is used as parameter to other commands (for eaxample, to close the Xml file).

3

Root element handle variable

Xml root element handle - a unique number that identifies the root element of the Xml file. It is used as input to other commands (for example, to get child elements and traverse the Xml file.

4

Password

Password used to decrypt the data. The password must be the same that was previously used to encrypt data (in 'xml_file_create'command). If incorrect password is provided then commands that reads data from the XML file ('xml_element_get', 'xml_attribute_get' or 'xml_findtext') fails. Leave the parameter empty if the data are not encrypted.

 

Example (Macro Steps):

 

1

<#> <#>This macro shows how to open and close an Xml file

2

Macro execution: ONLY COMMANDS

3

XML File Open File path = "c:\myXmlFileLocation\file.xml", File handle variable = "vXmlDoc", Root element handle variable = "vXmlRoot", Password = ""

4

<#> <#> Do something useful with the Xml file...

5

XML File Close "vXmlDoc"

Example (Plain Text):

 

<#>This macro shows how to open and close an Xml file

<cmds>

<xml_file_open>("c:\myXmlFileLocation\file.xml",vXmlDoc,vXmlRoot)

<#> Do something useful with the Xml file...

<xml_file_close>(vXmlDoc)