You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2001/09/14 22:04:00 UTC

cvs commit: xml-xalan/c/src/TestXSLT process.cpp

dbertoni    01/09/14 13:04:00

  Modified:    c/src/TestXSLT process.cpp
  Log:
  Clean-up and augmented exception handling.
  
  Revision  Changes    Path
  1.76      +28 -19    xml-xalan/c/src/TestXSLT/process.cpp
  
  Index: process.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/TestXSLT/process.cpp,v
  retrieving revision 1.75
  retrieving revision 1.76
  diff -u -r1.75 -r1.76
  --- process.cpp	2001/08/28 22:21:00	1.75
  +++ process.cpp	2001/09/14 20:03:59	1.76
  @@ -79,7 +79,7 @@
   
   
   #include <util/PlatformUtils.hpp>
  -#include <sax/SAXException.hpp>
  +#include <sax/SAXParseException.hpp>
   
   
   
  @@ -1231,7 +1231,7 @@
   		{
   			theResult = xsltMain(theParams);
   		}
  -		catch (XSLException& e)
  +		catch (const XSLException&	e)
   		{
   			cout << "\nXSLException ";
   
  @@ -1250,33 +1250,42 @@
   				cout << "Unknown URI";
   			}
   
  -			const int	theLineNumber = e.getLineNumber();
  +			cout << ", line "
  +				 << e.getLineNumber()
  +				 << ", column "
  +				 << e.getColumnNumber()
  +				 << ")"
  +				 << endl;
   
  -			if (theLineNumber != -1)
  -			{
  -				cout << ", line " << theLineNumber;
  -			}
  -			else
  -			{
  -				cout << ", unknown line";
  -			}
  +			theResult = -1;
  +		}
  +		catch (const SAXParseException&	e)
  +		{
  +			cout << "\nSAXParseException ";
  +
  +			cout << "Message is: " << e.getMessage() << " (";
   
  -			const int	theColumnNumber = e.getColumnNumber();
  +			const XMLCh* const	theSystemID = e.getSystemId();
   
  -			if (theColumnNumber != -1)
  +			if (theSystemID != 0)
   			{
  -				cout << ", column " << theColumnNumber;
  +				cout << XalanDOMString(theSystemID);
   			}
   			else
   			{
  -				cout << ", unknown column";
  +				cout << "Unknown system ID";
   			}
   
  -			cout << ")" << endl;
  +			cout << ", line "
  +				 << e.getLineNumber()
  +				 << ", column "
  +				 << e.getColumnNumber()
  +				 << ")"
  +				 << endl;
   
  -			theResult = -1;
  +			theResult = -2;
   		}
  -		catch (SAXException& e)
  +		catch (const SAXException&	e)
   		{
   			cout << "\nSAXException ";
   
  @@ -1284,7 +1293,7 @@
   
   			theResult = -2;
   		}
  -		catch (XMLException& e)
  +		catch (const XMLException&	e)
   		{
   			cout << "\nXMLException ";
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org