Type: |
Structure |
Available as of: |
V1.0.8.0 |
Inherits from: |
- |
The structure ST_XmlItem is used to describe an element or an attribute that is read from or written to an XML file.
Name |
Data type |
Description |
---|---|---|
diParentIndex |
DINT |
Indicates the index of the array where the parent element of the XML item is located (refer to Example for Hierarchical Relations Indicated by uiParentIndex). If the value is -1, the element is a root element. |
sName |
STRING[GPL.Gc_uiXmlLengthOfString] |
Name of the element or attribute. |
sValue |
STRING[GPL.Gc_uiXmlLengthOfString] |
Value of the element or attribute. |
etType |
Indicates the type of the XML item. |
|
uiNumOfAttributes |
ULINT |
This value depends on the type of the XML item: oIf the item is of type element, then the value indicates the number of associated attributes. oIf the item is of type attribute, then the value indicates the sequential number. |
oFB_XmlRead
oFB_XmlWrite
Example for Hierarchical Relations Indicated by uiParentIndex
The example illustrates the correlation between the parameter uiParentIndex in the buffer of type XmlItems provided by the application and the hierarchical structure in the XML document.
XML document |
Buffer of type XmlItems provided by the application |
---|---|
<?xml version="1.0" encoding="ASCII"?> |
![]()
|
Element |
Parent index |
Explanation |
---|---|---|
AAA |
–1 |
AAA is the root element. It has no parent. |
BBB |
0 |
AAA is the parent element. It is stored in array index 0. |
CCC |
0 |
|
DDD |
0 |
|
EEE |
3 |
DDD is the parent element. It is stored in array index 3. |