|
Class: Document (in HTML)
Object
|
+--HTML::AbstractElement
|
+--HTML::AbstractHTMLElement
|
+--HTML::Document
- Package:
- stx:goodies/webServer/htmlTree
- Category:
- Net-Documents-HTML-ModelTree-TopLevel
- Version:
- rev:
1.40
date: 2019/07/09 16:18:59
- user: matilk
- file: HTML__Document.st directory: goodies/webServer/htmlTree
- module: stx stc-classLibrary: htmlTree
instance creation
-
newFrameset
-
Create a new document of type HTML 4.01 frameset with webAddress http://www.w3.org/TR/html4/frameset.dtd
usage example(s):
self newFrameset htmlString
|
-
newStrict
-
Create a new document of type HTML 4.01 strict with webAddress http://www.w3.org/TR/html4/strict.dtd.
usage example(s):
self newStrict htmlString
|
-
newTransitional
-
Create a new document of type HTML 4.01 Transitional with webAddress http://www.w3.org/TR/html4/loose.dtd
usage example(s):
required protocol
-
tagName
-
accessing
-
docType
-
Return document type or nil.
-
docType: something
-
-
docTypeString
-
Return document type or nil.
-
fileName: aStringOrFileName
-
-
htmlVersion
-
-
htmlVersion: something
-
-
languageVariant
-
-
languageVariant: something
-
-
url
-
-
url: something
-
-
webAddress
-
-
webAddress: something
-
interface-accessing-elements
-
addHeading1: aHeading1OrString
-
Add a level one heading to the page.
The heading will be added as last
component in the body.
-
addHeading2: aHeading2OrString
-
Add a level two heading to the page.
The heading will be added as last
component in the body.
-
addHeading3: aHeading3OrString
-
Add a level three heading to the page.
The heading will be added as last
component in the body.
-
addHeading4: aHeading4OrString
-
Add a level four heading to the page.
The heading will be added as last
component in the body.
-
addHeading5: aHeading5OrString
-
Add a level five heading to the page.
The heading will be added as last
component in the body.
-
addHeading6: aHeading6OrString
-
Add a level six heading to the page.
The heading will be added as last
component in the body.
-
addHorizontalRule
-
Add a horizontal rule to the pages body.
-
addParagraph: aParagraphOrString
-
Add a level paragraph to the pages body.
The heading will be added as last
component in the body.
-
addTable
-
Add a level paragraph to the pages body.
The heading will be added as last
component in the body.
-
body
-
Return the body of the html-document.
-
body: anElement
-
-
head
-
Return the head of the html-document.
-
head: anElement
-
-
title: aTitleOrString
-
Set a title for this document.
The title will be displayed in the window title bar.
The title can be a simple string or a html-title object.
private-accessing
-
getBody
-
Return a body to add elements.
If no body exists, build one.
-
getHead
-
Return a head to add elements.
If no head exists, build one.
queries
-
canHaveChild: anotherElement in: aParser
-
return true, if anotherElement is allowed as my child
required-visiting
-
acceptHTMLVisitor: aVisitor
-
visitor pattern: dispatch me to the visitor
testing
-
isHTMLDocument
-
Example document with some headings to show something:
(A document itself would not show something. All
necessary top-level parts get built automatically.)
|document|
document := Document new.
document title: 'This is a generated title'.
document addHeading1: 'This is a generated level one heading'.
document addHeading2: 'This is a generated level two heading'.
document addHeading3: 'This is a generated level three heading'.
document addHeading4: 'This is a generated level four heading'.
document addHeading5: 'This is a generated level five heading'.
document addHeading6: 'This is a generated level six heading'.
document addParagraph: 'This is a generated paragraph
It contains text and text and text.'.
document addParagraph: 'This is a another generated paragraph.'.
document addHorizontalRule.
document htmlString.
|
A document with document type:
|document|
document := Document newStrict.
document htmlString.
|
A totaly empty document:
|document|
document := Document new.
document htmlString.
|
Document with a title:
(The necessary head gets generated automatically)
|document|
document := Document new.
document title:'This is a generated title'.
document htmlString.
|
|