Command xml.getelement

The command xml.getelement can be used to read the data of a XML file.


  1. filename [string]
    Name of the XML file you want to read.
  2. parentnode [string]
    XML root tag to be fetched.
  3. childnode [string]
    Tag that should be read and returned.
  4. variablevalue [string]
    Variable that will store the value of the returned element.
  5. variablereturn [integer]
    Variable that will store the return of the command.


In the example above, the function fn_xml_new_string creates and allocate in memory the XML contents. Don't forget replace the following characters < and > for lt; and gt; because both are reserved words in the POSXML language.

The function fn_xml_save_message opens the XML file and write all data. If the file not exists, it will be created automatically.

After finish the process, the function fn_xml_print_str will read the selected tags and print it.