Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
c9bfdf88
Commit
c9bfdf88
authored
Feb 14, 2001
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated to reflect the additional information and interfaces exported in
pyexpat.c revision 2.40.
parent
f035473a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
5 deletions
+43
-5
Doc/lib/libpyexpat.tex
Doc/lib/libpyexpat.tex
+43
-5
No files found.
Doc/lib/libpyexpat.tex
View file @
c9bfdf88
...
...
@@ -32,10 +32,14 @@ provide access to the Expat parser. Direct use of the
This module provides one exception and one type object:
\begin{excdesc}
{
e
rror
}
\begin{excdesc}
{
ExpatE
rror
}
The exception raised when Expat reports an error.
\end{excdesc}
\begin{excdesc}
{
error
}
Alias for
\exception
{
ExpatError
}
.
\end{excdesc}
\begin{datadesc}
{
XMLParserType
}
The type of the return values from the
\function
{
ParserCreate()
}
function.
...
...
@@ -126,6 +130,14 @@ Returns a string containing the base set by a previous call to
\method
{
SetBase()
}
hasn't been called.
\end{methoddesc}
\begin{methoddesc}
[xmlparser]
{
GetInputContext
}{}
Returns the input data that generated the current event as a string.
The data is in the encoding of the entity which contains the text.
When called while an event handler is not active, the return value is
\code
{
None
}
.
\versionadded
{
2.1
}
\end{methoddesc}
\begin{methoddesc}
[xmlparser]
{
ExternalEntityParserCreate
}{
context
\optional
{
,
encoding
}}
Create a ``child'' parser which can be used to parse an external
...
...
@@ -385,6 +397,32 @@ If this handler is not provided, external entities are reported by the
\end{methoddesc}
\subsection
{
ExpatError Exceptions
\label
{
expaterror-objects
}}
\sectionauthor
{
Fred L. Drake, Jr.
}{
fdrake@acm.org
}
\exception
{
ExpatError
}
exceptions have a number of interesting
attributes:
\begin{memberdesc}
[ExpatError]
{
code
}
Expat's internal error number for the specific error. This will
match one of the constants defined in the
\code
{
errors
}
object from
this module.
\versionadded
{
2.1
}
\end{memberdesc}
\begin{memberdesc}
[ExpatError]
{
lineno
}
Line number on which the error was detected. The first line is
numbered
\code
{
1
}
.
\versionadded
{
2.1
}
\end{memberdesc}
\begin{memberdesc}
[ExpatError]
{
offset
}
Character offset into the line where the error occurred. The first
column is numbered
\code
{
0
}
.
\versionadded
{
2.1
}
\end{memberdesc}
\subsection
{
Example
\label
{
expat-example
}}
The following program defines three handlers that just print out their
...
...
@@ -493,10 +531,10 @@ The model must occur zero or more times, as for \code{A*}.
\subsection
{
Expat error constants
\label
{
expat-errors
}}
\sectionauthor
{
A.M. Kuchling
}{
amk1@bigfoot.com
}
The following
table lists the error constants in the
\code
{
errors
}
object of the
\module
{
xml.parsers.expat
}
module. These
constants are useful in interpreting some of the attributes of the
parser object after
an error has occurred.
The following
constants are provided in the
\code
{
errors
}
object of
the
\refmodule
{
xml.parsers.expat
}
module. These constants are useful
in interpreting some of the attributes of the
\exception
{
ExpatError
}
exception objects raised when
an error has occurred.
The
\code
{
errors
}
object has the following attributes:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment