summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2003-04-17 22:36:52 (GMT)
committerFred Drake <fdrake@acm.org>2003-04-17 22:36:52 (GMT)
commit30b6e8230b443b82b544d5e1b34bb334710e4aac (patch)
treec5dacc80d721332be6ee08bb1526efb2a15d8079 /Doc
parent816653fccba672828bfae09422e701cfaac4a2d0 (diff)
downloadcpython-30b6e8230b443b82b544d5e1b34bb334710e4aac.zip
cpython-30b6e8230b443b82b544d5e1b34bb334710e4aac.tar.gz
cpython-30b6e8230b443b82b544d5e1b34bb334710e4aac.tar.bz2
Added documentation for the handle_pi() method, based on SF patch #662464.
Closes SF bug #659188, patch #662464.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/lib/libhtmlparser.tex16
1 files changed, 15 insertions, 1 deletions
diff --git a/Doc/lib/libhtmlparser.tex b/Doc/lib/libhtmlparser.tex
index 68c93e0..f7bbf63 100644
--- a/Doc/lib/libhtmlparser.tex
+++ b/Doc/lib/libhtmlparser.tex
@@ -123,8 +123,22 @@ inside the \code{<!}...\code{>} markup.It is intended to be overridden
by a derived class; the base class implementation does nothing.
\end{methoddesc}
+\begin{methoddesc}{handle_pi}{data}
+Method called when a processing instruction is encountered. The
+\var{data} parameter will contain the entire processing instruction.
+For example, for the processing instruction \code{<?proc color='red'>},
+this method would be called as \code{handle_pi("proc color='red'")}. It
+is intended to be overridden by a derived class; the base class
+implementation does nothing.
+
+\note{The \class{HTMLParser} class uses the SGML syntactic rules for
+processing instruction. An XHTML processing instruction using the
+trailing \character{?} will cause the \character{?} to be included in
+\var{data}.}
+\end{methoddesc}
+
-\subsection{Example HTML Parser \label{htmlparser-example}}
+\subsection{Example HTML Parser Application \label{htmlparser-example}}
As a basic example, below is a very basic HTML parser that uses the
\class{HTMLParser} class to print out tags as they are encountered: