<s>
Apache	B-Language
Cocoon	I-Language
,	O
usually	O
abbreviated	O
as	O
Cocoon	O
,	O
is	O
a	O
web	B-Application
application	I-Application
framework	I-Application
built	O
around	O
the	O
concepts	O
of	O
Pipeline	B-Operating_System
,	O
separation	O
of	O
concerns	O
,	O
and	O
component-based	O
web	O
development	O
.	O
</s>
<s>
The	O
framework	O
focuses	O
on	O
XML	B-Protocol
and	O
XSLT	B-Application
publishing	O
and	O
is	O
built	O
using	O
the	O
Java	B-Language
programming	I-Language
language	I-Language
.	O
</s>
<s>
Cocoon	O
's	O
use	O
of	O
XML	B-Protocol
is	O
intended	O
to	O
improve	O
compatibility	O
of	O
publishing	O
formats	O
,	O
such	O
as	O
HTML	B-Language
and	O
PDF	B-Application
.	O
</s>
<s>
The	O
content	B-Protocol
management	I-Protocol
systems	I-Protocol
Apache	B-Application
Lenya	I-Application
and	O
Daisy	B-Protocol
have	O
been	O
created	O
on	O
top	O
of	O
the	O
framework	O
.	O
</s>
<s>
Cocoon	O
is	O
also	O
commonly	O
used	O
as	O
a	O
data	O
warehousing	O
ETL	O
tool	O
or	O
as	O
middleware	B-General_Concept
for	O
transporting	O
data	O
between	O
systems	O
.	O
</s>
<s>
Apache	B-Language
Cocoon	I-Language
uses	O
sitemaps	O
to	O
allow	O
users	O
to	O
control	O
a	O
variety	O
of	O
components	O
in	O
the	O
Cocoon	O
software	O
,	O
as	O
well	O
as	O
define	O
the	O
client-server	B-Operating_System
interactions	O
in	O
what	O
Cocoon	O
refers	O
to	O
as	O
the	O
Pipelines	B-Operating_System
.	O
</s>
<s>
Matchers	O
are	O
used	O
to	O
match	O
user	O
requests	O
such	O
as	O
URLs	O
or	O
cookies	B-Application
against	O
wildcard	B-Algorithm
or	O
regular	B-Language
expression	I-Language
patterns	O
.	O
</s>
<s>
It	O
is	O
within	O
a	O
matcher	O
that	O
the	O
response	B-General_Concept
to	O
a	O
particular	O
request	O
is	O
specified	O
.	O
</s>
<s>
Generators	O
create	O
a	O
stream	B-Architecture
of	O
data	O
for	O
further	O
processing	O
.	O
</s>
<s>
This	O
stream	B-Architecture
can	O
be	O
generated	O
from	O
an	O
existing	O
XML	B-Protocol
document	I-Protocol
or	O
there	O
are	O
generators	O
that	O
can	O
create	O
XML	B-Protocol
from	O
scratch	O
to	O
represent	O
something	O
on	O
the	O
server	O
,	O
such	O
as	O
a	O
directory	O
structure	O
or	O
image	O
data	O
.	O
</s>
<s>
One	O
type	O
of	O
generator	O
is	O
an	O
XML	B-Protocol
Server	O
Page	O
(	O
XSP	O
)	O
,	O
an	O
XML	B-Protocol
document	I-Protocol
containing	O
tag-based	O
directives	O
that	O
specify	O
how	O
to	O
generate	O
dynamic	O
content	O
at	O
request	O
time	O
.	O
</s>
<s>
Upon	O
Cocoon	O
processing	O
,	O
these	O
directives	O
are	O
replaced	O
by	O
generated	O
content	O
so	O
that	O
the	O
resulting	O
,	O
augmented	O
XML	B-Protocol
document	I-Protocol
can	O
be	O
subject	O
to	O
further	O
processing	O
(	O
typically	O
an	O
XSLT	B-Application
transformation	O
)	O
.	O
</s>
<s>
XSPs	O
are	O
transformed	O
into	O
Cocoon	O
producers	O
,	O
typically	O
as	O
Java	B-Language
classes	O
,	O
though	O
any	O
scripting	O
language	O
for	O
which	O
a	O
Java-based	O
processor	O
exists	O
could	O
also	O
be	O
used	O
.	O
</s>
<s>
Tags	O
are	O
defined	O
using	O
XSLT	B-Application
templates	O
that	O
describe	O
how	O
the	O
tags	O
(	O
represented	O
as	O
XML	B-Protocol
nodes	O
)	O
are	O
transformed	O
into	O
other	O
XML	B-Protocol
nodes	O
or	O
into	O
procedural	O
code	O
such	O
as	O
Java	B-Language
.	O
</s>
<s>
Transformers	O
take	O
a	O
stream	B-Architecture
of	O
data	O
and	O
change	O
it	O
in	O
some	O
way	O
.	O
</s>
<s>
The	O
most	O
common	O
transformations	O
are	O
performed	O
with	O
XSLT	B-Application
to	O
change	O
one	O
XML	B-Protocol
format	O
into	O
another	O
.	O
</s>
<s>
But	O
there	O
are	O
also	O
transformers	O
that	O
take	O
other	O
forms	O
of	O
data	O
(	O
SQL	B-Language
commands	O
for	O
example	O
)	O
.	O
</s>
<s>
A	O
serializer	O
turns	O
an	O
XML	B-Protocol
event	O
stream	B-Architecture
into	O
a	O
sequence	O
of	O
bytes	O
(	O
such	O
as	O
HTML	B-Language
)	O
that	O
can	O
be	O
returned	O
to	O
the	O
client	O
.	O
</s>
<s>
Some	O
serializers	O
allow	O
you	O
to	O
send	O
the	O
data	O
in	O
many	O
different	O
formats	O
including	O
HTML	B-Language
,	O
XHTML	B-Language
,	O
PDF	B-Application
,	O
RTF	O
,	O
SVG	B-Application
,	O
WML	B-General_Concept
and	O
plain	O
text	O
,	O
for	O
example	O
.	O
</s>
<s>
They	O
are	O
able	O
to	O
select	O
particular	O
elements	O
of	O
a	O
request	O
and	O
choose	O
the	O
correct	O
pipeline	B-Operating_System
part	O
to	O
use	O
.	O
</s>
<s>
A	O
view	O
is	O
an	O
exit	O
point	O
in	O
a	O
pipeline	B-Operating_System
.	O
</s>
<s>
You	O
can	O
put	O
out	O
the	O
XML-Stream	O
which	O
is	O
produced	O
till	O
this	O
point	O
.	O
</s>
<s>
Publish	O
content	O
without	O
parsing	O
it	O
(	O
no	O
XML	B-Protocol
processing	O
)	O
.	O
</s>
<s>
Actions	O
are	O
Java	B-Language
classes	O
that	O
execute	O
some	O
business	O
logic	O
or	O
manage	O
new	O
content	O
production	O
.	O
</s>
<s>
A	O
pipeline	B-Operating_System
is	O
used	O
to	O
specify	O
how	O
the	O
different	O
Cocoon	O
components	O
interact	O
with	O
a	O
given	O
request	O
to	O
produce	O
a	O
response	B-General_Concept
.	O
</s>
<s>
A	O
typical	O
pipeline	B-Operating_System
consists	O
of	O
a	O
generator	O
,	O
followed	O
by	O
zero	O
or	O
more	O
transformers	O
,	O
and	O
finally	O
a	O
serializer	O
.	O
</s>
