LoadXMLFile Method
9.0B, PLBCMP GUI Only
The LoadXMLFile method stores the contents of an XML file into a LISTVIEW object. The method uses the following format:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
object
Required. A LISTVIEW object that is accessed.
return
Optional. A Numeric Variable that indicates the success or failure of the method.
fname
Required. A Character String Variable or literal that specifies the file name or the XML data stream to be loaded directly.
options
Optional. A decimal number or Numeric Variable that specifies the load options.
tname
Optional. A Character String Variable or literal that specifies the table name.
rname
Optional. A Character String Variable or literal that specifies the row name.
Flags Affected: EOS, OVER, ZERO
Note the following:
The {*FileName} parameter allows either the file name of an XML file or an XML data stream as extracted from an XFILE. The XML data stream may be retrieved using the GETFILE XMLDATA.
If the value returned is zero, the ZERO Condition Flag is set.
The OVER and EOS Condition Flags are always cleared.
When running under the PL/B Application Server, the first character of the file name has special meaning:
|
Value |
The file ... |
|
! (exclamation mark) |
resides on the client rather than the server. |
|
? (question mark) |
should be either obtained from the cache or from the server and placed in the cache. |
|
* (asterisk) |
should be either obtained from the in-memory cache or from the server and placed only in the in-memory cache. |
The {options} value is a constant as defined in PLBMETH.INC or a numeric variable indicating one or more of the following option values:
|
Keyword |
Value |
Meaning ... |
|
$LV_XMLRD_IGNORE_ATTR |
0x1 |
Ignore attributes when loading a file. If not used, attributes are treated as columns. |
|
$LV_XMLRD_NO_CONV |
0x2 |
Do not convert an underscore in an element name to blanks. |
|
$LV_XMLRD_USECOLUMNS |
0x4 |
Use the column names existing in the LISTVIEW. If not used, column names are obtained from the XML file. |
|
$LV_XMLWR_ISO8859 |
0x100 |
Enables ISO8859 encoding. |
If not specified, {tname} defaults to 'Table' and {rname} defaults to 'Row'.
A return value of zero (0) indicates success. Failures return one of the values described as follows:
|
Value |
Meaning ... |
|
1 |
A write operation has already been started. |
|
2 |
Unable to create specified XML file. |
|
3 |
Unable to open specified XML file. |
|
4 |
Unable to create XML parser. |
|
5 |
Out of memory. |
|
6 |
Attempt to write an attribute on an closed element. |
|
7 |
Tag name too long. |
|
8 |
Invalid tag name. |
|
9 |
XML data too large. |
|
10 |
XML file too large for memory area. |
|
11 |
File write error. |
|
12 |
Internal state error. |
|
13 |
No element open. |
|
14 |
Internal state error. |
|
15 |
Attribute not open. |
|
16 |
Error detected parsing XML data file. |
|
200 |
Unable to retrieve XML file from Application Server. |
|
201 |
The ListView has no columns or there is insufficient memory to process columns. |
This method is supported when using the PL/B Web Server with the LINUX/Linux operating system.
See Also: Method Syntax, LISTVIEW Methods
![]() |