diff options
Diffstat (limited to 'Doc/lib/libsgmllib.tex')
-rw-r--r-- | Doc/lib/libsgmllib.tex | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/Doc/lib/libsgmllib.tex b/Doc/lib/libsgmllib.tex index a8dfa0b..e441c12 100644 --- a/Doc/lib/libsgmllib.tex +++ b/Doc/lib/libsgmllib.tex @@ -1,7 +1,7 @@ \section{\module{sgmllib} --- - Simple SGML parser.} -\declaremodule{standard}{sgmllib} + Simple SGML parser} +\declaremodule{standard}{sgmllib} \modulesynopsis{Only as much of an SGML parser as needed to parse HTML.} \index{SGML} @@ -10,7 +10,7 @@ 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 \module{htmllib}\refstmodindex{htmllib} +only exists as a base for the \refmodule{htmllib}\refstmodindex{htmllib} module. @@ -49,8 +49,8 @@ implicitly at instantiation time. \begin{methoddesc}{setnomoretags}{} Stop processing tags. Treat all following input as literal input -(CDATA). (This is only provided so the HTML tag \code{<PLAINTEXT>} -can be implemented.) +(CDATA). (This is only provided so the HTML tag +\code{<PLAINTEXT>} can be implemented.) \end{methoddesc} \begin{methoddesc}{setliteral}{} @@ -72,15 +72,15 @@ redefined version should always call \method{close()}. \begin{methoddesc}{handle_starttag}{tag, method, attributes} This method is called to handle start tags for which either a -\code{start_\var{tag}()} or \code{do_\var{tag}()} method has been +\method{start_\var{tag}()} or \method{do_\var{tag}()} method has been defined. The \var{tag} argument is the name of the tag converted to lower case, and the \var{method} argument is the bound method which should be used to support semantic interpretation of the start tag. -The \var{attributes} argument is a list of \code{(\var{name}, \var{value})} -pairs containing the attributes found inside the tag's \code{<>} -brackets. The \var{name} has been translated to lower case and double -quotes and backslashes in the \var{value} have been interpreted. For -instance, for the tag \code{<A HREF="http://www.cwi.nl/">}, this +The \var{attributes} argument is a list of \code{(\var{name}, +\var{value})} pairs containing the attributes found inside the tag's +\code{<>} brackets. The \var{name} has been translated to lower case +and double quotes and backslashes in the \var{value} have been interpreted. +For instance, for the tag \code{<A HREF="http://www.cwi.nl/">}, this method would be called as \samp{unknown_starttag('a', [('href', 'http://www.cwi.nl/')])}. The base implementation simply calls \var{method} with \var{attributes} as the only argument. @@ -88,11 +88,11 @@ method would be called as \samp{unknown_starttag('a', [('href', \begin{methoddesc}{handle_endtag}{tag, method} This method is called to handle endtags for which an -\code{end_\var{tag}()} method has been defined. The \var{tag} -argument is the name of the tag converted to lower case, and the -\var{method} argument is the bound method which should be used to +\method{end_\var{tag}()} method has been defined. The +\var{tag} argument is the name of the tag converted to lower case, and +the \var{method} argument is the bound method which should be used to support semantic interpretation of the end tag. If no -\code{end_\var{tag}()} method is defined for the closing element, +\method{end_\var{tag}()} method is defined for the closing element, this handler is not called. The base implementation simply calls \var{method}. \end{methoddesc} @@ -120,12 +120,12 @@ This method is called to process a general entity reference of the form \samp{\&\var{ref};} where \var{ref} is an general entity reference. It looks for \var{ref} in the instance (or class) variable \member{entitydefs} which should be a mapping from entity -names to corresponding translations. -If a translation is found, it calls the method \method{handle_data()} -with the translation; otherwise, it calls the method -\code{unknown_entityref(\var{ref})}. The default \member{entitydefs} -defines translations for \code{\&}, \code{\&apos}, \code{\>}, -\code{\<}, and \code{\"}. +names to corresponding translations. If a translation is found, it +calls the method \method{handle_data()} with the translation; +otherwise, it calls the method \code{unknown_entityref(\var{ref})}. +The default \member{entitydefs} defines translations for +\code{\&}, \code{\&apos}, \code{\>}, \code{\<}, and +\code{\"}. \end{methoddesc} \begin{methoddesc}{handle_comment}{comment} @@ -175,8 +175,8 @@ case: \begin{methoddescni}{start_\var{tag}}{attributes} This method is called to process an opening tag \var{tag}. It has -preference over \code{do_\var{tag}()}. The \var{attributes} -argument has the same meaning as described for +preference over \method{do_\var{tag}()}. The +\var{attributes} argument has the same meaning as described for \method{handle_starttag()} above. \end{methoddescni} @@ -192,10 +192,10 @@ This method is called to process a closing tag \var{tag}. Note that the parser maintains a stack of open elements for which no end tag has been found yet. Only tags processed by -\code{start_\var{tag}()} are pushed on this stack. Definition of an -\code{end_\var{tag}()} method is optional for these tags. For tags -processed by \code{do_\var{tag}()} or by \method{unknown_tag()}, no -\code{end_\var{tag}()} method must be defined; if defined, it will not -be used. If both \code{start_\var{tag}()} and \code{do_\var{tag}()} -methods exist for a tag, the \code{start_\var{tag}()} method takes -precedence. +\method{start_\var{tag}()} are pushed on this stack. Definition of an +\method{end_\var{tag}()} method is optional for these tags. For tags +processed by \method{do_\var{tag}()} or by \method{unknown_tag()}, no +\method{end_\var{tag}()} method must be defined; if defined, it will +not be used. If both \method{start_\var{tag}()} and +\method{do_\var{tag}()} methods exist for a tag, the +\method{start_\var{tag}()} method takes precedence. |