XML_PARSER
|
Syntax: |
XML_PARSER(<Filename>,<Filter>,<Macroname>)
|
||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||
|
Meaning: |
XML_PARSER
parses a XML file and calls the macro <Macroname> each time an element
has been processed. A
XML file consists of a sequence of nested elements, e.g. <name>Smith</name>.
<name> is called begin
element, Smith is called element value and </name>
is called end element. The
macro <Macroname> is called three times while an element is processed.
In the macro EBUS_DATA$ contains the
element name resp. the element value and EBUS_DATA
contains the information why the macro has been called.
While
a XML file is parsed EBUS_DATA$ may contain linefeeds, tabulators and blanks.
With <Filter> these characters can be ignored. If <Filter>
contains 'l' linefeeds are ignored, if <Filter> contains 't' tabulators
are ignored and if <Filter> contains 'b' blanks are ignored. XML_PARSER
returns the following result values:
|
||||||||||||||||||||||||
|
Parameter: |
|
||||||||||||||||||||||||
|
Sample: |
RET% = PARSE_XML("Test.xml","tlb",PROCESS.XML) IF RET% <> 1 THEN ERRORMES =
"Error " + STR$(RET%) ENDIF Macro PROCESS.XML: CASE EBUS_DATA
OF 1 // EBUS_DATA$ contains the begin element,
e.g. "name"
OF 2 // EBUS_DATA$ contains the element value,
e.g. "Smith"
OF 3 // EBUS_DATA$ contains the end element, e.g.
"name" ENDCASE |
||||||||||||||||||||||||
|
See also: |
|