|
|
Class: HTMLParser
Object
|
+--HTMLParser
- Package:
- stx:libhtml
- Category:
- System-Documentation
- Version:
- rev:
1.66
date: 2009/10/01 06:59:19
- user: cg
- file: HTMLParser.st directory: libhtml
- module: stx stc-classLibrary: libhtml
- Author:
- Claus Gittinger
instances of this class are used to read HTML documents
and build a collection of markup elements.
This markup-collection can be displayed using the HTMLDocumentViewer
or printed by the HTMLDocumentPrinter.
HTMLMarkup
HTMLDocumentView
HTMLDocumentPainter
HTMLDocumentPrinter
initialization
-
initialize
-
-
initializeAmpersandEscapes
-
-
initializeMathAmpersandEscapes
-
these are obsolete now, as HTML4 added the missing stuff in the meantime.
parsing
-
parseText: aStringOrStream
-
parse aStringOrStream.and answer the parsed document
-
parseText: aStringOrStream characterEncoding: anEncodingString
-
parse aStringOrStream. The encoding of the character set is specified by anEncodingString
(e.g. #utf8 or 'iso8859-1').
Answer the parsed document
accessing
-
characterEncoding: aString
-
set the character set / ecoding for the following text
error reporting
-
infoMessage: msg
-
scanning
-
ampersandEscape
-
parse an ampersand escape; the '&' has already been read.
-
ampersandEscape: aString
-
return a new string, containing the ampersand escape character.
Expects aString to NOT contain the initial ampersand.
-
ampersandEscapeString
-
parse an ampersand escape; the '&' has already been read.
Return the escape string.
-
extractMetaInformationFrom: element
-
-
finishTextBlock
-
finish a scanned textBlock; add it to the markup list
-
finishTextBlockWithDecode: doDecode
-
finish a scanned textBlock; add it to the markup list
-
parseMarkup
-
parse '<' and return a markup element
-
parseText: aStringOrStream
-
parse some string, return a list of markups
-
parseText: aStringOrStream withBindings: metaBindings
-
parse some string, return a list of HTMLMarkups.
Ampersand variables (i.e. &url) are expanded as given in the
metabindings dictionary.
(this seems to be non-standard HTML, but is used in hotjava).
The destination is only required for scripts, which may want to access
document very early.
-
parseText: aStringOrStream withBindings: metaBindings for: aDestination
-
parse some string, return a list of HTMLMarkups.
Ampersand variables (i.e. &url) are expanded as given in the
metabindings dictionary.
(this seems to be non-standard HTML, but is used in hotjava).
The destination is only required for scripts, which may want to access
document very early.
-
startNewTextBlock
-
scripts
-
parseJavaScriptFrom: scriptStream
-
-
parseSmalltalkScriptFrom: scriptStream
-
-
script: element
-
a <script> TAG was encountered.
check for the language (which defaults to javaScript) and dispatch
to a script language handler.
-
script_javascript: element
-
a <script language=javaScript> TAG was encountered.
parse the script, and construct the scriptObject
-
script_smalltalkscript: element
-
a <script language=smalltalkScript> TAG was encountered.
parse the script, and construct the scriptObject (which has the methods in
its anonymous class)
|p in document|
p := HTMLParser new.
in := '../../doc/online/english/TOP.html' asFilename readStream.
document := p parseText:in.
in close.
document inspect
|
|v document|
v := HTMLDocumentView new openAndWait.
v homeDocument:'../../doc/online/english/TOP.html'.
|
|top v document|
top := StandardSystemView extent:200@500.
v := HVScrollableView for:HTMLDocumentView miniScrollerH:true in:top.
v origin:0.0@ 0.0 corner:1.0@1.0.
top openAndWait.
v homeDocument:'../../doc/online/english/TOP.html'.
|
|v document|
v := HTMLDocumentView new openAndWait.
document := (HTMLParser new)
parseText:('../../doc/online/english/programming/viewintro.html'
asFilename readStream).
v document:document.
|
|