Build and Run SAXErrorHandling C-C++ example


In this topic, you will build and run SAXErrorHandling C/C++ example.

From the Build menu, select Build Solution. This will build the application. When you build the application, Visual Studio will create the debug directory that contains the newly built executable. You need to build the example before creating the XML file because you need to create the XML file in the debug directory, see Resource: books.xml for SAXErrorHandling example.

  • Start a command prompt and change directories to the debug directory that contains the SAXErrorHandling executable and the books.xml file.

  • Run the example by entering the following at the command prompt: SAXErrorHandling.exe books.xml

You should get the following output in a console window.

Parsing document: books.xml  
<?xml version="1.0" ?><books>  
   <book id="bk001">  
      <title>The First Book</title>  
      <review>An amazing story of nothing.</review>  
   <book id="bk002">  
      <title>The Poet's First Poem</title>  
      <review>Least poetic poems  
Error Message:  
The name in the end tag of the element must match the element type in the start tag.  
Error C00CEE3B