Unicorn XML Toolkit
Version 1.00.00

Namespace Sax
Class CSaxParseException

class CSaxParseException: public CSaxException {
public:
    CSaxParseException(
        const CString &strMessage,
        const XLocator &pLocator);
    CSaxParseException(
        const CString &strMessage,
        const XLocator &pLocator,
        IException *pException);
    CSaxParseException(
        const CString &strMessage,
        const CString &strPublicId,
        const CString &strSystemId,
        int nLineNumber,
        int nColumnNumber);
    CSaxParseException(
        const CString &strMessage,
        const CString &strPublicId,
        const CString &strSystemId,
        int nLineNumber,
        int nColumnNumber,
        IException *pException);
    ~CSaxParseException();
public:
    CString GetPublicId();
    CString GetSystemId();
    int GetLineNumber();
    int GetColumnNumber();
    };

The XML parse error or warning.

This exception will include information for locating the error in the original XML document. Note that although the application will receive the CSaxParseException object as the argument to the handlers in the CErrorHandler class, the application is not actually required to throw the exception; instead, it can simply read the information in it and take a different action.

Since this exception is a subclass of CSaxException , it inherits the ability to wrap another exception.

Since:
1.00.00
Version:
1.00.00
Author:
C++ interfaces by Alexey Gokhberg; based on the original SAX2 specification by David Megginson
See Also:
CLocator
Constructor/Destructor Summary
CSaxParseException (const CString &strMessage, const XLocator &pLocator);
����������Constructs the SAX parse exception from a message and a locator.
CSaxParseException (const CString &strMessage, const XLocator &pLocator, IException *pException);
����������Constructs the SAX parse exception, wrapping an existing exception.
CSaxParseException (const CString &strMessage, const CString &strPublicId, const CString &strSystemId, int nLineNumber, int nColumnNumber);
����������Constructs the SAX parse exception.
CSaxParseException (const CString &strMessage, const CString &strPublicId, const CString &strSystemId, int nLineNumber, int nColumnNumber, IException *pException);
����������Constructs the SAX parse exception with the embedded exception.
~CSaxParseException ();
����������Destroys the SAX parse exception.

Function Summary
CString GetPublicId ();
����������Gets the public identifier of the entity where the exception occurred.
CString GetSystemId ();
����������Gets the system identifier of the entity where the exception occurred.
int GetLineNumber ();
����������Gets the line number of the end of the text where the exception occurred.
int GetColumnNumber ();
����������Gets the column number of the end of the text where the exception occurred.

Constructor/Destructor Detail

CSaxParseException

CSaxParseException(
    const CString &strMessage,
    const XLocator &pLocator);

Constructs the SAX parse exception from a message and a locator.

This constructor is especially useful when an application is creating its own exception from within a CContentHandler callback.

Parameters:
strMessage - the error or warning message
pLocator - the locator object for the error or warning (may be NULL )

CSaxParseException

CSaxParseException(
    const CString &strMessage,
    const XLocator &pLocator,
    IException *pException);

Constructs the SAX parse exception, wrapping an existing exception.

This constructor is especially useful when an application is creating its own exception from within a CContentHandler callback, and needs to wrap an existing exception that is not a subclass of CSaxException .

Parameters:
strMessage - the error or warning message, or the empty string to use the message from the embedded exception
pLocator - the locator object for the error or warning (may be NULL )
pException - any exception

CSaxParseException

CSaxParseException(
    const CString &strMessage,
    const CString &strPublicId,
    const CString &strSystemId,
    int nLineNumber,
    int nColumnNumber);

Constructs the SAX parse exception.

This constructor is most useful for reader developers.

If the system identifier is a URL, the reader must resolve it fully before creating the exception.

Parameters:
strMessage - the error or warning message
strPublicId - the public identifer of the entity that generated the error or warning
strSystemId - the system identifer of the entity that generated the error or warning
nLineNumber - the line number of the end of the text that caused the error or warning
nColumnNumber - the column number of the end of the text that caused the error or warning

CSaxParseException

CSaxParseException(
    const CString &strMessage,
    const CString &strPublicId,
    const CString &strSystemId,
    int nLineNumber,
    int nColumnNumber,
    IException *pException);

Constructs the SAX parse exception with the embedded exception.

This constructor is most useful for reader developers who need to wrap an exception that is not a subclass of CSaxException .

If the system identifier is a URL, the reader must resolve it fully before creating the exception.

Parameters:
strMessage - the error or warning message, or the empty string to use the message from the embedded exception
strPublicId - the public identifer of the entity that generated the error or warning
strSystemId - the system identifer of the entity that generated the error or warning
nLineNumber - the line number of the end of the text that caused the error or warning
nColumnNumber - the column number of the end of the text that caused the error or warning
pException - another exception to embed in this one

~CSaxParseException

~CSaxParseException();

Destroys the SAX parse exception.

Function Detail

GetPublicId

CString GetPublicId();

Gets the public identifier of the entity where the exception occurred.

Returns:
a string containing the system identifier, or the empty string if none is available

GetSystemId

CString GetSystemId();

Gets the system identifier of the entity where the exception occurred.

If the system identifier is a URL, it will be resolved fully.

Returns:

GetLineNumber

int GetLineNumber();

Gets the line number of the end of the text where the exception occurred.

Returns:
an integer representing the column number, or -1 if none is available

GetColumnNumber

int GetColumnNumber();

Gets the column number of the end of the text where the exception occurred.

The first column in a line is position 1 .

Returns:
an integer representing the column number, or -1 if none is available

Unicorn XML Toolkit
Version 1.00.00


This document was created using Unicorn DOC++.

Copyright 1999-2001 Unicorn Enterprises SA.
All Rights Reserved.