Class SAXParseException
Encapsulate an XML parse error or warning.
Implements
Inherited Members
Namespace: Sax
Assembly: Lucene.Net.Benchmark.dll
Syntax
[Serializable]
public class SAXParseException : SAXException, ISerializable
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. Seehttp://www.saxproject.org for further information.
This exception may include information for locating the error in the original XML document, as if it came from a ILocator object. Note that although the application will receive a SAXParseException as the argument to the handlers in the IErrorHandler interface, 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 SAXException, it inherits the ability to wrap another exception.Constructors
SAXParseException(string, ILocator)
Create a new SAXParseException from a message and a ILocator.
Declaration
public SAXParseException(string message, ILocator locator)
Parameters
Type | Name | Description |
---|---|---|
string | message | The error or warning message. |
ILocator | locator | The locator object for the error or warning (may be null). |
Remarks
This constructor is especially useful when an application is creating its own exception from within a IContentHandler callback.
See Also
SAXParseException(string, ILocator, Exception)
Wrap an existing exception in a SAXParseException.
Declaration
public SAXParseException(string message, ILocator locator, Exception e)
Parameters
Type | Name | Description |
---|---|---|
string | message | The error or warning message, or null to use the message from the embedded exception. |
ILocator | locator | The locator object for the error or warning (may be null). |
Exception | e | Any exception. |
Remarks
This constructor is especially useful when an application is creating its own exception from within a IContentHandler callback, and needs to wrap an existing exception that is not a subclass of SAXException.
See Also
SAXParseException(string, string, string, int, int)
Create a new SAXParseException.
Declaration
public SAXParseException(string message, string publicId, string systemId, int lineNumber, int columnNumber)
Parameters
Type | Name | Description |
---|---|---|
string | message | The error or warning message. |
string | publicId | The public identifier of the entity that generated the error or warning. |
string | systemId | The system identifier of the entity that generated the error or warning. |
int | lineNumber | The line number of the end of the text that caused the error or warning. |
int | columnNumber | The column number of the end of the text that cause the error or warning. |
Remarks
This constructor is most useful for parser writers.
All parameters except the message are as if they were provided by a ILocator. For example, if the system identifier is a URL (including relative filename), the caller must resolve it fully before creating the exception.See Also
SAXParseException(string, string, string, int, int, Exception)
Create a new SAXParseException with an embedded exception.
Declaration
public SAXParseException(string message, string publicId, string systemId, int lineNumber, int columnNumber, Exception e)
Parameters
Type | Name | Description |
---|---|---|
string | message | The error or warning message, or null to use the message from the embedded exception. |
string | publicId | The public identifier of the entity that generated the error or warning. |
string | systemId | The system identifier of the entity that generated the error or warning. |
int | lineNumber | The line number of the end of the text that caused the error or warning. |
int | columnNumber | The column number of the end of the text that cause the error or warning. |
Exception | e | Another exception to embed in this one. |
Remarks
This constructor is most useful for parser writers who need to wrap an exception that is not a subclass of SAXException.
All parameters except the message and exception are as if they were provided by a ILocator. For example, if the system identifier is a URL (including relative filename), the caller must resolve it fully before creating the exception.See Also
Properties
ColumnNumber
The column number of the end of the text where the exception occurred.
The first column in a line is position 1. An integer representing the column number, or -1 if none is available.Declaration
public int ColumnNumber { get; }
Property Value
Type | Description |
---|---|
int |
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. Seehttp://www.saxproject.org for further information.
This exception may include information for locating the error in the original XML document, as if it came from a ILocator object. Note that although the application will receive a SAXParseException as the argument to the handlers in the IErrorHandler interface, 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 SAXException, it inherits the ability to wrap another exception.See Also
LineNumber
The line number of the end of the text where the exception occurred.
The first line is line 1. An integer representing the line number, or -1 if none is available.Declaration
public int LineNumber { get; }
Property Value
Type | Description |
---|---|
int |
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. Seehttp://www.saxproject.org for further information.
This exception may include information for locating the error in the original XML document, as if it came from a ILocator object. Note that although the application will receive a SAXParseException as the argument to the handlers in the IErrorHandler interface, 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 SAXException, it inherits the ability to wrap another exception.See Also
PublicId
Get the public identifier of the entity where the exception occurred. Returns a string containing the public identifier, or null if none is available.
Declaration
public string PublicId { get; }
Property Value
Type | Description |
---|---|
string |
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. Seehttp://www.saxproject.org for further information.
This exception may include information for locating the error in the original XML document, as if it came from a ILocator object. Note that although the application will receive a SAXParseException as the argument to the handlers in the IErrorHandler interface, 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 SAXException, it inherits the ability to wrap another exception.See Also
SystemId
Get the system identifier of the entity where the exception occurred.
If the system identifier is a URL, it will have been resolved fully. A string containing the system identifier, or null if none is available.Declaration
public string SystemId { get; }
Property Value
Type | Description |
---|---|
string |
Remarks
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. Seehttp://www.saxproject.org for further information.
This exception may include information for locating the error in the original XML document, as if it came from a ILocator object. Note that although the application will receive a SAXParseException as the argument to the handlers in the IErrorHandler interface, 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 SAXException, it inherits the ability to wrap another exception.