xmlparse
function xmlparse(afct:array(range) of string|function,mode:integer,ctx:ctxtype): integer
afct
|
Event function table. Each entry of this array is the name of or a reference to the function to call when the corresponding event occurs. The expected events are (all of these entries are optional):
|
||||||||||||||||
mode
|
If
0, spaces are preserved and returned as text elements. Otherwise all text elements are trimmed
|
||||||||||||||||
ctx
|
Value passed as first argument of all event functions
|
! Display element name and update indentation public function start_elt(spce:text,name:text,nba:integer):integer writeln(spce,name) spce+=" " end-function ! Update indentation when element closes function end_elt(spce:text):integer spce-=" " end-function declarations afct:array(range) of any end-declarations afct(XML_FCT_OPEN_ELT):="start_elt" ! define open element afct(XML_FCT_CLOSE_ELT):=->end_elt ! define close element fopen("mydocument.xml",F_INPUT) rts:=xmlparse(afct,1,text("")) fclose(F_INPUT)
- XML_FCT_DECL
- function xmldecl(ctx:ctxtype, vers:text, enc:text, std:integer):integer
- XML_FCT_TXT
- function text_node(ctx:ctxtype, type:integer, data:text):integer
- XML_FCT_CDATA
- function cdata_node(ctx:ctxtype, type:integer, data:text):integer
- XML_FCT_COM
- function comment_node(ctx:ctxtype, type:integer, data:text):integer
- XML_FCT_DATA
- function data_node(ctx:ctxtype, type:integer, data:text):integer
- XML_FCT_PINST
- function processing_instr(ctx:ctxtype, target:text, data:text):integer
- XML_FCT_OPEN_ELT
- function open_element(ctx:ctxtype, name:text, nba:integer):integer
- XML_FCT_CLOSE_ELT
- function close_element(ctx:ctxtype):integer
The type passed to the text node functions is the XML type corresponding to the function (namely XML_TXT, XML_CDATA, XML_COM, XML_DATA).
The open_element function receives the name of the element as well as the number of defined attributes. To retrieve these attributes xmlattr can be used.
© 2001-2025 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.