Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: cleaning up old wiki formatting

...

The MarkupWriter interface allows the majority of component code to treat the generation of output as a stream. In reality, MarkupWriter is more like a cursor into the DOM tree, and the DOM may ultimately be operated upon in a random access manner (rather than the serial (or buffered) approach used in Tapestry 4). Wiki Markup{

Div
stylefloat:right

...

; width

...

:30%

...

Info

...

title

...

A

...

Note

...

For

...

Tapestry

...

4

...

Users

...

In

...

Tapestry

...

4,

...

markup

...

generation

...

was

...

based

...

on

...

generating

...

a

...

character

...

stream.

...

At

...

the

...

lowest

...

level,

...

the

...

fact

...

that

...

the

...

output

...

was

...

in

...

a

...

markup

...

format

...

such

...

as

...

HTML,

...

XHTML

...

or

...

WML

...

was

...

not

...

known.

...

Higher

...

levels,

...

such

...

as

...

the

...

IMarkupWriter

...

interface

...

(and

...

its

...

implementations)

...

provide

...

the

...

concept

...

of

...

markup

...

generation:

...

elements,

...

attributes,

...

start

...

tags

...

and

...

end

...

tags.

...

This

...

technique

...

breaks

...

down

...

when

...

two

...

elements

...

are

...

peers,

...

and

...

not

...

in

...

a

...

parent/child

...

relationship.

...

For

...

example,

...

the

...

rendering

...

of

...

a

...

FieldLabel

...

component

...

is

...

affected

...

by

...

its

...

companion

...

TextField

...

component.

...

Handling

...

these

...

cases

...

in

...

Tapestry

...

4

...

required

...

a

...

number

...

of

...

kludges

...

and

...

special

...

cases.

...

DOM Classes

The implementation of this DOM is part of Tapestry, despite the fact that several third-party alternatives exist. This represents a desire to limit dependencies for the framework, but also the Tapestry DOM is streamlined for initial creation, and a limited amount of subsequent modification. Most DOM implementations are more sophisticated than needed for Tapestry, with greater support for querying (often using XPath) and manipulation.

...