This example parses an XML file according to the SAX mechanism

The input to this example is the following XML file:

xmlExampleSaxParsing.xml

<?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_parseSaxFromFile()' function:

  callBacks[fwXml_SAXSTARTELEMENT] = "myStartElement";
  callBacks[fwXml_SAXENDELEMENT] = "myEndElement";
  callBacks[fwXml_SAXTEXT] = "myText";
  
  rtn_code = fwXml_parseSaxFromFile ( xml_full_name , callBacks , exInfo );

Note that the current implementation passes via the DOM parsing that reads the complete XML file before it starts the parsing according to the SAX mechanism... For that reason, 'fwXml_parseSaxFromFile' returns an error-code in case the XML file contains errors, in which case the error-message, error-line and error-column are returned...

Three callbacks can be defined: