XMLFindElement (FB)¶
FUNCTION_BLOCK XMLFindElement
Finds a xml element by name and attribute. Use the function block XMLFindElementAsync for large XML files to find the value asynchronously. To read from file set sFileName to file path and paDataArray = 0. To read from data array set sFileName = ‚‘ and paDataArray to data pointer.
- InOut:
Scope
Name
Type
Initial
Comment
Input
sFileNameSTRING(255)Path to a xml file
wsElementWSTRING(gc_udiMaxValueSize)The element to find. if blank, the root element will be returend.
attributeAttributes of the xml element to find.
readModeRead mode
paElementsPOINTER TO XMLElement
Pointer to the result set
udiMaxElementsUDINTMaximum size of paElements
udiStartPositionUDINT0
Start position in bytes
xTruncateValuesBOOLFALSE
true: All values that exceed the maximum value size will be truncated
paDataArrayPOINTER TO BYTE
0
Pointer to XML data array, if 0 read from file (sFileName)
udiDataArraySizeUDINT0
Size of paDataArray
Output
eErrorError
udiCountElementsUDINTNumber of elemnents in paElements
udiNextReadPosUDINTPosition in file (in bytes) of the next xml element, 0 if last element
eEncodingEncoding of the xml file