This example returns all 'home', 'room' and 'floor' Element-Nodes
The input to this example is the following XML file:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE home []> <home colour="white" floors="2"> <infos>This is my house</infos> <floor level="0"> <room type="other">Entry-hall</room> <room type="kitchen" ground="stone"/> <room type="living" ground="parquet">Table<sep/>Sofa<sep/>TV</room> </floor> <floor level="1"> <room type="other">Bathroom</room> <bedrooms count="3" colour="creme"> <room use="parents" beds="1"/> <room use="kids" beds="3"/> <room use="spare" colour="pine">Computer<sep/>Play-ground</room> </bedrooms> </floor> </home>
The code in the example only calls ONCE the 'fwXml_elementsByTagName()' function for each of the following Tag-Names:
elements = fwXml_elementsByTagName ( docum , -1 , "home" , exInfo ); elements = fwXml_elementsByTagName ( docum , -1 , "room" , exInfo ); elements = fwXml_elementsByTagName ( docum , -1 , "floor" , exInfo );
The program then prints out the list of returned Tag-Nodes:
WCCOAui1:["document = 0"] WCCOAui1:["TagName of Node 1 = 'home' Attribs = 'colour:white | floors:2'"] WCCOAui1:[""] WCCOAui1:["TagName of Node 31 = 'room' Attribs = 'type:other'"] WCCOAui1:["TagName of Node 32 = 'room' Attribs = 'ground:stone | type:kitchen'"] WCCOAui1:["TagName of Node 33 = 'room' Attribs = 'ground:parquet | type:living'"] WCCOAui1:["TagName of Node 40 = 'room' Attribs = 'type:other'"] WCCOAui1:["TagName of Node 43 = 'room' Attribs = 'beds:1 | use:parents'"] WCCOAui1:["TagName of Node 44 = 'room' Attribs = 'beds:3 | use:kids'"] WCCOAui1:["TagName of Node 45 = 'room' Attribs = 'colour:pine | use:spare'"] WCCOAui1:[""] WCCOAui1:["TagName of Node 53 = 'floor' Attribs = 'level:0'"] WCCOAui1:["TagName of Node 54 = 'floor' Attribs = 'level:1'"] WCCOAui1:[""] WCCOAui1:["rtn_code = 0"]