|
Class: Encoder (in HTML)
Object
|
+--HTML::Visitor
|
+--HTML::Encoder
|
+--HTML::XHTMLEncoder
- Package:
- stx:goodies/webServer/htmlTree
- Category:
- Net-Documents-HTML-TreeBuilder
- Version:
- rev:
1.97
date: 2019/07/13 12:20:41
- user: cg
- file: HTML__Encoder.st directory: goodies/webServer/htmlTree
- module: stx stc-classLibrary: htmlTree
instance creation
-
new
-
Create a new encoder.
Build the necessary stream.
-
on: aStream
-
Create an encoder on a stream.
accessing
-
htmlString
-
Return the html string.
Call this after doing a '#visit:'.
-
stream
-
Return the stream the encoder encodes on.
-
stream: aStream
-
initialization
-
initialize
-
Set the indent depth to a default.
Attention: Direct instance variable
access relies on this setting
private-accessing
-
setStream: aStream
-
Set a stream as the stream to print on.
Private - Use only for instance creation.
private-printing
-
attributeValuesPrintString: aRawObject
-
Print an attribute value or a list of attribute values.
aRawObject can be a string, a style object or a collection of those.
-
printAttribute: anAssociation
-
Print a single attribute given as an association
with key and value onto a stream.
The value sometimes can be a collection of values.
-
printAttributesOf: anElement
-
Print all set attributes of an
item onto the stream.
Attributes can be nil for no
attributes which is the default.
Otherwise will be key value pairs.
They are representated as 'key=value' in HTML.
-
printNewLineIndent
-
Print a carriage return and an indent
of length indent onto the stream,
but only if there is no inlining.
New line and indent are always printed
together. There is no newline without
indenting and no intenting witout a new
line.
-
printScriptElement: aScriptElement
-
A script element gets printed.
-
printStyleElement: aStyleElement
-
A style element gets printed.
private-printing-tags
-
printInline: anElement
-
An element gets printed inline.
-
printSingle: anElement
-
Print an element without contents.
Do not use '<tag/>' or '<tag />', because it is not valid HTML 4.01,
(the first one is valid only in XHTML).
-
printSingle: anElement withSpace: withSpace
-
Print an element without contents.
Ignore withSpace, since it produces invalid HTML code.
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
printTagsFor: anElement do: aBlock
-
Print both tags for an element and evaluate a block which
is printing other data between the tags.
private-queries
-
areChildrenSimpleOf: element
-
visiting
-
visitSubelement: aSubElement
-
Visit a subelement.
Care for indent and newlines
-
visitSubelement: aSubElement indent: doIndent
-
Visit a subelement.
Care for indent and newlines
-
visitSubelementsOf: anElement
-
Visit the subelements of an element.
-
visitSubelementsOf: anElement indent: wantIndent
-
Visit the subelements of an element.
visiting - required
-
visitComment: aComment
-
(comment from inherited method)
A comment gets visited.
-
visitElement: anElement
-
The task of this encoder is to print html code.
So print a default version of every item of the tree.
-
visitProcessingInstruction: aProcessingInstruction
-
(comment from inherited method)
A processing instruction gets visited.
-
visitString: aString
-
A string gets visited.
We like to print it onto our stream.
visiting-BlockLevel
-
visitDiv: aDiv
-
(comment from inherited method)
A div gets visited.
visiting-Form
-
visitOption: anOptionElement
-
-
visitTextArea: anInput
-
A textarea gets visited.
visiting-Head
-
visitScript: aScript
-
A script gets visited.
-
visitStyle: aStyle
-
A style element gets visited.
-
visitStyleElement: anElement
-
-
visitTitle: aTitle
-
A title element gets visited.
visiting-Inline
-
visitAnchor: anAnchor
-
-
visitArea: anArea
-
-
visitBreak: aLineBreak
-
-
visitInput: anInput
-
visiting-ListDefinition
-
visitDefinitionTerm: aTerm
-
A definition term gets visited.
visiting-Table
-
visitTableDataCell: aTableDataCell
-
-
visitTableHeaderCell: aTableHeaderCell
-
visiting-TopLevel
-
visitDocument: aDocument
-
A document gets visited.
Redefined to display the document type if existent.
|