]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Added more information on the differences between the htmllib and HTMLParser
authorFred Drake <fdrake@acm.org>
Thu, 5 Jul 2001 16:34:36 +0000 (16:34 +0000)
committerFred Drake <fdrake@acm.org>
Thu, 5 Jul 2001 16:34:36 +0000 (16:34 +0000)
modules.

Doc/lib/libhtmllib.tex
Doc/lib/libhtmlparser.tex
Doc/lib/libsgmllib.tex

index 508d00404680d313d9500dee4d55a4ce401b94cb..666affbf239cc131ce205113380fddfb6cf6b61d 100644 (file)
@@ -70,6 +70,12 @@ handlers for all HTML 2.0 and many HTML 3.0 and 3.2 elements.
 
 
 \begin{seealso}
+  \seemodule{HTMLParser}{Alternate HTML parser that offers a slightly
+                         lower-level view of the input, but is
+                         designed to work with XHTML, and does not
+                         implement some of the SGML syntax not used in
+                         ``HTML as deployed'' and which isn't legal
+                         for XHTML.}
   \seemodule{htmlentitydefs}{Definition of replacement text for HTML
                              2.0 entities.}
   \seemodule{sgmllib}{Base class for \class{HTMLParser}.}
index e8b4dd92c0e1bf6c93438ca60a0228253cc84433..68c93e015e86a5b503d2f88afb982ae272445560 100644 (file)
@@ -6,7 +6,9 @@
 
 This module defines a class \class{HTMLParser} which serves as the
 basis for parsing text files formatted in HTML\index{HTML} (HyperText
-Mark-up Language) and XHTML.\index{XHTML}
+Mark-up Language) and XHTML.\index{XHTML}  Unlike the parser in
+\refmodule{htmllib}, this parser is not based on the SGML parser in
+\refmodule{sgmllib}.
 
 
 \begin{classdesc}{HTMLParser}{}
@@ -15,6 +17,10 @@ The \class{HTMLParser} class is instantiated without arguments.
 An HTMLParser instance is fed HTML data and calls handler functions
 when tags begin and end.  The \class{HTMLParser} class is meant to be
 overridden by the user to provide a desired behavior.
+
+Unlike the parser in \refmodule{htmllib}, this parser does not check
+that end tags match start tags or call the end-tag handler for
+elements which are closed implicitly by closing an outer element.
 \end{classdesc}
 
 
index 5fe0c8d4dd8af991210744160819ada5d6b51f28..3699d241e09c7b9b89338a7f873e67766e17edea 100644 (file)
@@ -10,8 +10,9 @@ This module defines a class \class{SGMLParser} which serves as the
 basis for parsing text files formatted in SGML (Standard Generalized
 Mark-up Language).  In fact, it does not provide a full SGML parser
 --- it only parses SGML insofar as it is used by HTML, and the module
-only exists as a base for the \refmodule{htmllib}\refstmodindex{htmllib}
-module.
+only exists as a base for the \refmodule{htmllib} module.  Another
+HTML parser which supports XHTML and offers a somewhat different
+interface is available in the \refmodule{HTMLParser} module.
 
 
 \begin{classdesc}{SGMLParser}{}