< Extension:External Data 
 
        
      In addition to the standard "local variables" that External Data's functions populate when they retrieve data, there are a number of "special variables" that get automatically populated after certain calls. These variables' names all start with two underscores. In some cases (the __xml, __json and __yamlvariables), their values do not hold text but rather a full object, so they may only be useful when called from within Lua, but they are still available to any code that calls them.
The following variables will get populated with parsed text, i.e. calls that include the |format= parameter:
__xml- contains the complete XML structure, for theXMLformat (meaningful only in Lua)__json- contains the complete JSON structure, forJSONformat (in Lua)__yaml- contains the complete JSON structure corresponding to the YAML data, forYAMLformat (in Lua)__text- contains the complete text, for thetextformat__comment- contains any comments from the text, for theINIformat__start,__end,__lines,__total- contain information about the amount of the original text that was parsed, for use with the|start line=, etc. parameters
Calls to #get_web_data and #get_soap_data will also populate the following variables:
__time- contains the time that the data was fetched on, as a Unix timestamp__stale-true, if data could not be fetched, and a stale cache was used;falseotherwise__tries- the number of attempts needed to fetch the data
Calls to #get_file_data will populate the following variable:
__file- holds the name of the file, relative to the$edgDirectoryPathsetting (populated only if thedirectoryparameter is used)
    This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.