This example reads hierarchical data
The input to this example is the following XML file:
<Earch> <Europe> <England lan="E"> </England> <Switzerland lan="F/I/D"> <Geneva lan="F"> <Geneva/> <Meyrin/> <Versoix/> </Geneva> <Bern lan="D"> <Bern/> </Bern> <Valais lan="F/D"> <Sion lan="F"/> <Martigny lan="F"/> </Valais> </Switzerland> </Europe> <America> <Usa lan="E"> <New-York/> <Florida> </Florida> </Usa> <Brazil lan="P"> </Brazil> <Argentina lan="E"/> </America> </Earch>
The code in the example calls the 'fwXml_childNodesContent()' function more than once:
rtn_code = fwXml_childNodesContent ( xml_doc_ident , top_elem_ident , node_names , attributes , nodevalues , exInfo );
The return-code in this example is '2' even though the child-nodes are only element-nodes,
but they in turn contain below them element-nodes, thus the returned value is [1< The program then prints out the returned information in the three dynamic variables in the following form:
if the key 'fwXml_CHILDNODESTYPE' is present then one has to do with a element-node!
In this case the key 'fwXml_CHILDSUBTREEID' will also be present that identifies the 'top_elem_ident'
to be used in the next call to the function 'fwXml_childNodesContent()'.
WCCOAui1:["document = 0"]
WCCOAui1:["1-child = 0"]
WCCOAui1:["topelem = [0] 'Earch'"]
WCCOAui1:["rtn_code = 2"]
WCCOAui1:["TagName = [1] 'Europe'"]
WCCOAui1:["rtn_code = 2"]
WCCOAui1:["TagName = [2] 'England' Attribs 'lan:E'"]
WCCOAui1:["TagName = [2] 'Switzerland' Attribs 'lan:F/I/D'"]
WCCOAui1:["rtn_code = 2"]
WCCOAui1:["TagName = [3] 'Geneva' Attribs 'lan:F'"]
WCCOAui1:["rtn_code = 0"]
WCCOAui1:["TagName = [4] 'Geneva'"]
WCCOAui1:["TagName = [4] 'Meyrin'"]
WCCOAui1:["TagName = [4] 'Versoix'"]
WCCOAui1:["TagName = [3] 'Bern' Attribs 'lan:D'"]
WCCOAui1:["rtn_code = 0"]
WCCOAui1:["TagName = [4] 'Bern'"]
WCCOAui1:["TagName = [3] 'Valais' Attribs 'lan:F/D'"]
WCCOAui1:["rtn_code = 0"]
WCCOAui1:["TagName = [4] 'Sion' Attribs 'lan:F'"]
WCCOAui1:["TagName = [4] 'Martigny' Attribs 'lan:F'"]
WCCOAui1:["TagName = [1] 'America'"]
WCCOAui1:["rtn_code = 2"]
WCCOAui1:["TagName = [2] 'Usa' Attribs 'lan:E'"]
WCCOAui1:["rtn_code = 0"]
WCCOAui1:["TagName = [3] 'New-York'"]
WCCOAui1:["TagName = [3] 'Florida'"]
WCCOAui1:["TagName = [2] 'Brazil' Attribs 'lan:P'"]
WCCOAui1:["TagName = [2] 'Argentina' Attribs 'lan:E'"]
WCCOAui1:["rtn_code = 0"]