eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'HTML::Encoder':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: Encoder (in HTML)


Inheritance:

   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

Class protocol:

instance creation
o  new
Create a new encoder.
Build the necessary stream.

o  on: aStream
Create an encoder on a stream.


Instance protocol:

accessing
o  htmlString
Return the html string.
Call this after doing a '#visit:'.

o  stream
Return the stream the encoder encodes on.

o  stream: aStream

initialization
o  initialize
Set the indent depth to a default.
Attention: Direct instance variable
access relies on this setting

private-accessing
o  setStream: aStream
Set a stream as the stream to print on.
Private - Use only for instance creation.

private-printing
o  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.

o  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.

o  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.

o  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.

o  printScriptElement: aScriptElement
A script element gets printed.

o  printStyleElement: aStyleElement
A style element gets printed.

private-printing-tags
o  printInline: anElement
An element gets printed inline.

o  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).

o  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) **

o  printTagsFor: anElement do: aBlock
Print both tags for an element and evaluate a block which
is printing other data between the tags.

private-queries
o  areChildrenSimpleOf: element

visiting
o  visitSubelement: aSubElement
Visit a subelement.
Care for indent and newlines

o  visitSubelement: aSubElement indent: doIndent
Visit a subelement.
Care for indent and newlines

o  visitSubelementsOf: anElement
Visit the subelements of an element.

o  visitSubelementsOf: anElement indent: wantIndent
Visit the subelements of an element.

visiting - required
o  visitComment: aComment
(comment from inherited method)
A comment gets visited.

o  visitElement: anElement
The task of this encoder is to print html code.
So print a default version of every item of the tree.

o  visitProcessingInstruction: aProcessingInstruction
(comment from inherited method)
A processing instruction gets visited.

o  visitString: aString
A string gets visited.
We like to print it onto our stream.

visiting-BlockLevel
o  visitDiv: aDiv
(comment from inherited method)
A div gets visited.

visiting-Form
o  visitOption: anOptionElement

o  visitTextArea: anInput
A textarea gets visited.

visiting-Head
o  visitScript: aScript
A script gets visited.

o  visitStyle: aStyle
A style element gets visited.

o  visitStyleElement: anElement

o  visitTitle: aTitle
A title element gets visited.

visiting-Inline
o  visitAnchor: anAnchor

o  visitArea: anArea

o  visitBreak: aLineBreak

o  visitInput: anInput

visiting-ListDefinition
o  visitDefinitionTerm: aTerm
A definition term gets visited.

visiting-Table
o  visitTableDataCell: aTableDataCell

o  visitTableHeaderCell: aTableHeaderCell

visiting-TopLevel
o  visitDocument: aDocument
A document gets visited.
Redefined to display the document type if existent.



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Fri, 07 Oct 2022 18:02:00 GMT