eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'HTML::Document':

Home

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

Class: Document (in HTML)


Inheritance:

   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

Class protocol:

instance creation
o  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     

o  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     

o  newTransitional
Create a new document of type HTML 4.01 Transitional with webAddress http://www.w3.org/TR/html4/loose.dtd

usage example(s):

     self newTransitional

required protocol
o  tagName


Instance protocol:

accessing
o  docType
Return document type or nil.

o  docType: something

o  docTypeString
Return document type or nil.

o  fileName: aStringOrFileName

o  htmlVersion

o  htmlVersion: something

o  languageVariant

o  languageVariant: something

o  url

o  url: something

o  webAddress

o  webAddress: something

interface-accessing-elements
o  addHeading1: aHeading1OrString
Add a level one heading to the page.

The heading will be added as last
component in the body.

o  addHeading2: aHeading2OrString
Add a level two heading to the page.

The heading will be added as last
component in the body.

o  addHeading3: aHeading3OrString
Add a level three heading to the page.

The heading will be added as last
component in the body.

o  addHeading4: aHeading4OrString
Add a level four heading to the page.

The heading will be added as last
component in the body.

o  addHeading5: aHeading5OrString
Add a level five heading to the page.

The heading will be added as last
component in the body.

o  addHeading6: aHeading6OrString
Add a level six heading to the page.

The heading will be added as last
component in the body.

o  addHorizontalRule
Add a horizontal rule to the pages body.

o  addParagraph: aParagraphOrString
Add a level paragraph to the pages body.

The heading will be added as last
component in the body.

o  addTable
Add a level paragraph to the pages body.

The heading will be added as last
component in the body.

o  body
Return the body of the html-document.

o  body: anElement

o  head
Return the head of the html-document.

o  head: anElement

o  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
o  getBody
Return a body to add elements.
If no body exists, build one.

o  getHead
Return a head to add elements.
If no head exists, build one.

queries
o  canHaveChild: anotherElement in: aParser
return true, if anotherElement is allowed as my child

required-visiting
o  acceptHTMLVisitor: aVisitor
visitor pattern: dispatch me to the visitor

testing
o  isHTMLDocument


Examples:


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.


ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Tue, 19 Mar 2024 03:05:11 GMT