You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2002/07/02 15:06:42 UTC
cvs commit: xml-cocoon2/src/webapp/welcome cocoon.gif status2html.xsl welcome.xhtml
cziegeler 2002/07/02 06:06:42
Added: src/webapp/samples old_sitemap.xmap
src/webapp/samples/docs/samples error-giving-page.xml
hello-page.xml sample-apps.xml sample-dynamic.xml
sample-static.xml sample-xsp.xml samples.xml
src/webapp/samples/docs/samples/fo readme.fo
src/webapp/samples/docs/samples/forms add-department.xsp
add-employee.xsp employee.xml employee.xsp
process-department.xsp process-employee.xsp
src/webapp/samples/docs/samples/formvalidation ERROR.xsp
OK.xsp descriptor.xml
src/webapp/samples/docs/samples/referer/a a.xml b.xml
src/webapp/samples/docs/samples/referer/b a.xml b.xml
src/webapp/samples/docs/samples/script-action
addknowncourse.js addunknowncse.js addunknownte.js
createuser.js deleteknown.js deleteunknown.js
login.js updateinfo.js
src/webapp/samples/docs/samples/scripts hello.js hello.py
src/webapp/samples/docs/samples/session-state start.xsp
state01.xsp state11.xsp state12.xsp state21.xsp
state22.xsp
src/webapp/samples/docs/samples/sites jakarta_apache_org.xml
java_apache_org.xml
src/webapp/samples/docs/samples/slides clean-page.xml
database-page.xml ldap.xml lib-page.xml page.xml
pyramid-model.gif schema.jpg slides.xml
view-source.xsp
src/webapp/samples/docs/samples/soap fortune.xml
getquote.xml joke.xml temperature.xml
src/webapp/samples/docs/samples/sql sql-page.xml
sql-page.xml.sql
src/webapp/samples/docs/samples/stream OrderPage.xml
src/webapp/samples/docs/samples/svg henryV.svg opac.svg
src/webapp/samples/docs/samples/xscript simple.xsp
soap-getquote1.xsl soap-getquote1.xsp
soap-getquote2.xsp soap-getquote3.xsl
soap-getquote3.xsp
src/webapp/samples/docs/samples/xsp aggregate.xsp
cacheable.xsp cookie.xsp esql.xsd esql.xsp
hello.xsp logicsheet.xsp request.xsp resolver.xsp
response.xsp session.xsp sessionpage.xsp simple.xsp
upload.xsp
src/webapp/samples/docs/samples/xsp-js hello.xsp request.xsp
response.xsp session.xsp simple.xsp
src/webapp/samples/docs/samples/xsp-py hello.xsp
src/webapp/samples/logicsheets hello.xsl
src/webapp/samples/myapp readme.html sitemap.xmap
src/webapp/samples/myapp/xml page.xml
src/webapp/samples/myapp/xsl style.xsl
src/webapp/samples/myapp/xsp page.xsp
src/webapp/samples/stylesheets deli_test.xsl
dynamic-page2html.xsl fragment-extractor.xsl
simple-samples2html.xsl simple-sql2html.xsl
simple-xml2html.xsl svg-samples2html.xsl
src/webapp/samples/stylesheets/documents book2sidebar.xsl
root2html.xsl
src/webapp/samples/stylesheets/news moreover.xsl news.xsl
slashdot.xsl xmlhack.xsl
src/webapp/samples/stylesheets/page simple-page2fo.xsl
simple-page2html.xsl simple-page2svg.xsl
simple-page2vml.xsl simple-page2vrml.xsl
simple-page2wml.xsl
src/webapp/samples/stylesheets/parentcm time.xsl
src/webapp/samples/stylesheets/sitemap
simple-sitemap2html.xsl
src/webapp/samples/stylesheets/sites
jakarta_apache_org-html.xsl
java_apache_org-html.xsl
src/webapp/samples/stylesheets/slides slides-apachecon.xsl
slides-navigation.xsl
src/webapp/samples/stylesheets/system directory2html.xsl
error2html.xsl profile2html.xsl status2html.xsl
src/webapp/samples/stylesheets/xmlform xmlform2html.xsl
src/webapp/samples/templates hello-page.vm
src/webapp/samples/welcome cocoon.gif status2html.xsl
welcome.xhtml
Removed: src/webapp/docs/samples error-giving-page.xml hello-page.xml
sample-apps.xml sample-dynamic.xml
sample-static.xml sample-xsp.xml samples.xml
src/webapp/docs/samples/fo readme.fo
src/webapp/docs/samples/forms add-department.xsp
add-employee.xsp employee.xml employee.xsp
process-department.xsp process-employee.xsp
src/webapp/docs/samples/formvalidation ERROR.xsp OK.xsp
descriptor.xml
src/webapp/docs/samples/referer/a a.xml b.xml
src/webapp/docs/samples/referer/b a.xml b.xml
src/webapp/docs/samples/script-action addknowncourse.js
addunknowncse.js addunknownte.js createuser.js
deleteknown.js deleteunknown.js login.js
updateinfo.js
src/webapp/docs/samples/scripts hello.js hello.py
src/webapp/docs/samples/session-state start.xsp state01.xsp
state11.xsp state12.xsp state21.xsp state22.xsp
src/webapp/docs/samples/sites jakarta_apache_org.xml
java_apache_org.xml
src/webapp/docs/samples/slides clean-page.xml
database-page.xml ldap.xml lib-page.xml page.xml
pyramid-model.gif schema.jpg slides.xml
view-source.xsp
src/webapp/docs/samples/soap fortune.xml getquote.xml
joke.xml temperature.xml
src/webapp/docs/samples/sql sql-page.xml sql-page.xml.sql
src/webapp/docs/samples/stream OrderPage.xml
src/webapp/docs/samples/svg henryV.svg opac.svg
src/webapp/docs/samples/xscript simple.xsp
soap-getquote1.xsl soap-getquote1.xsp
soap-getquote2.xsp soap-getquote3.xsl
soap-getquote3.xsp
src/webapp/docs/samples/xsp aggregate.xsp cacheable.xsp
cookie.xsp esql.xsd esql.xsp hello.xsp
logicsheet.xsp request.xsp resolver.xsp
response.xsp session.xsp sessionpage.xsp simple.xsp
upload.xsp
src/webapp/docs/samples/xsp-js hello.xsp request.xsp
response.xsp session.xsp simple.xsp
src/webapp/docs/samples/xsp-py hello.xsp
src/webapp/logicsheets hello.xsl
src/webapp/myapp readme.html sitemap.xmap
src/webapp/myapp/xml page.xml
src/webapp/myapp/xsl style.xsl
src/webapp/myapp/xsp page.xsp
src/webapp/stylesheets deli_test.xsl dynamic-page2html.xsl
fragment-extractor.xsl simple-samples2html.xsl
simple-sql2html.xsl simple-xml2html.xsl
svg-samples2html.xsl
src/webapp/stylesheets/documents book2sidebar.xsl
root2html.xsl
src/webapp/stylesheets/news moreover.xsl news.xsl
slashdot.xsl xmlhack.xsl
src/webapp/stylesheets/page simple-page2fo.xsl
simple-page2html.xsl simple-page2svg.xsl
simple-page2vml.xsl simple-page2vrml.xsl
simple-page2wml.xsl
src/webapp/stylesheets/parentcm time.xsl
src/webapp/stylesheets/sitemap simple-sitemap2html.xsl
src/webapp/stylesheets/sites jakarta_apache_org-html.xsl
java_apache_org-html.xsl
src/webapp/stylesheets/slides slides-apachecon.xsl
slides-navigation.xsl
src/webapp/stylesheets/system directory2html.xsl
error2html.xsl profile2html.xsl status2html.xsl
src/webapp/stylesheets/xmlform xmlform2html.xsl
src/webapp/templates hello-page.vm
src/webapp/welcome cocoon.gif status2html.xsl welcome.xhtml
Log:
Forcing things: moved everything except resources into the samples directory breaking some more samples...next thing will be the resources going somewhere else...
Revision Changes Path
1.1 xml-cocoon2/src/webapp/samples/old_sitemap.xmap
Index: old_sitemap.xmap
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<!--
This is the 'heart' of Cocoon. The sitemap maps URI space to
resources. It consists basicly of two parts: components and
pipelines. Pipelines are made out of components. There is such a
vast number of components available that it would be impossible to
describe them here, please refer to the accompanying
documentation. For specific components, have a look also at the
javadocs for them. Most pipelines are present to demonstrate some
feature or technique, often they are explained in more detail in
the accompanying documentation.
There are some other, less important parts that deal with
resources, views and action sets. For now, ignore them.
-->
<!-- =========================== Components ================================ -->
<map:components>
<!--
All pipelines consist at least of two components: a generator, that
produces the content and a serialiser, that delivers the content to
the client.
More precisely: a generator generates SAX events and a serializer
consumes these events and produces a character stream.
Some things to note here: each generator has a unique name, this
name is mapped to a java class, one name is declared as default
generator. In addition each generator may have additional
configurations as child elements.
Additional attributes are targeted at the component manager. The optional
"label" attribute is relevant for the view concept below. The optional
"logger" attribute defines the logging category where messages produced
by a component should go. If there's no "logger" attribute, the category
used is the one defined for the "sitemap" component in cocoon.xconf.
We have chosen in this example sitemap to use a different logging category
for each component, which allows fine-grained classification of log
messages. But you are free to use any category you want.
It is possible to have the same java class declared as different
generators by using different names. No configuration options are
shared between these instances, however.
All components follow this schema.
-->
<map:generators default="file">
<map:generator label="content,data" logger="sitemap.generator.file" name="file" pool-grow="4" pool-max="32" pool-min="8" src="org.apache.cocoon.generation.FileGenerator"/>
<map:generator label="content,data" logger="sitemap.generator.serverpages" name="serverpages" pool-grow="2" pool-max="32" pool-min="4" src="org.apache.cocoon.generation.ServerPagesGenerator"/>
<map:generator label="content,data" logger="sitemap.generator.directory" name="directory" pool-grow="2" pool-max="16" pool-min="2" src="org.apache.cocoon.generation.DirectoryGenerator"/>
<map:generator label="data" logger="sitemap.generator.request" name="request" pool-grow="2" pool-max="16" pool-min="2" src="org.apache.cocoon.generation.RequestGenerator"/>
<map:generator label="data" logger="sitemap.generator.status" name="status" pool-grow="2" pool-max="16" pool-min="2" src="org.apache.cocoon.generation.StatusGenerator"/>
<map:generator label="content,data" logger="sitemap.generator.imagedirectory" name="imagedirectory" src="org.apache.cocoon.generation.ImageDirectoryGenerator"/>
<map:generator label="data" logger="sitemap.generator.extractor" name="extractor" src="org.apache.cocoon.generation.FragmentExtractorGenerator"/>
<map:generator label="content,data" name="html" src="org.apache.cocoon.generation.HTMLGenerator"/>
<map:generator label="content,data" name="jsp" src="org.apache.cocoon.generation.JspGenerator"/>
<map:generator label="content,data" name="stream" src="org.apache.cocoon.generation.StreamGenerator"/>
<map:generator label="content,data" name="script" src="org.apache.cocoon.generation.ScriptGenerator"/>
<map:generator label="content,data" name="velocity" src="org.apache.cocoon.generation.VelocityGenerator"/>
</map:generators>
<!--
Transformers can be placed inside the pipeline between the generator
and the serializer. You may have as many transformers as you
like. Transformers consume SAX events and emmit SAX events.
The "xalan" transformer is an example of a component with additional
configuration.
-->
<map:transformers default="xslt">
<!-- NOTE: This used to be the default XSLT processor. The default now is XSLTC -->
<map:transformer name="xalan" logger="sitemap.transformer.xslt" pool-grow="2" pool-max="32" pool-min="8" src="org.apache.cocoon.transformation.TraxTransformer">
<use-request-parameters>false</use-request-parameters>
<use-browser-capabilities-db>false</use-browser-capabilities-db>
<use-deli>false</use-deli>
</map:transformer>
<!--
NOTE: XSLTC is now the default processor. If you use Xalan extensions,
use the "xalan" transformer.
-->
<map:transformer name="xslt" src="org.apache.cocoon.transformation.TraxTransformer"
logger="sitemap.transformer.xsltc"
pool-max="32" pool-min="8" pool-grow="2">
<use-request-parameters>false</use-request-parameters>
<use-browser-capabilities-db>false</use-browser-capabilities-db>
<use-deli>false</use-deli>
<!-- transformer-factory>org.apache.xalan.xsltc.trax.TransformerFactoryImpl</transformer-factory -->
</map:transformer>
<map:transformer logger="sitemap.transformer.log" name="log" pool-grow="2" pool-max="16" pool-min="2" src="org.apache.cocoon.transformation.LogTransformer"/>
<map:transformer logger="sitemap.transformer.xinclude" name="xinclude" pool-grow="2" pool-max="16" pool-min="2" src="org.apache.cocoon.transformation.XIncludeTransformer"/>
<map:transformer logger="sitemap.transformer.cinclude" name="cinclude" pool-grow="2" pool-max="16" pool-min="2" src="org.apache.cocoon.transformation.CIncludeTransformer"/>
<map:transformer logger="sitemap.transformer.sql" name="sql" src="org.apache.cocoon.transformation.SQLTransformer"/>
<map:transformer logger="sitemap.transformer.extractor" name="extractor" src="org.apache.cocoon.transformation.FragmentExtractorTransformer"/>
<map:transformer logger="sitemap.transformer.filter" name="filter" src="org.apache.cocoon.transformation.FilterTransformer"/>
<map:transformer logger="sitemap.transformer.writeDOMsession" name="writeDOMsession" src="org.apache.cocoon.transformation.WriteDOMSessionTransformer"/>
<map:transformer logger="sitemap.transformer.readDOMsession" name="readDOMsession" src="org.apache.cocoon.transformation.ReadDOMSessionTransformer"/>
<map:transformer logger="sitemap.transformer.encodeURL" name="encodeURL" src="org.apache.cocoon.transformation.EncodeURLTransformer"/>
<map:transformer logger="sitemap.transformer.write-source" name="write-source" src="org.apache.cocoon.transformation.SourceWritingTransformer"/>
</map:transformers>
<!--
Readers are an exception to the above rule that a pipline need to
have exactly one generator and exactly one serializer. Readers
circumvent the XML oriented SAX pipeline model, think of a reader
being a generator and a serializer at once thus a pipeline may not
contain any generator, transformer or serializer in addition to a
reader. They are useful for delivering binary content like images.
-->
<map:readers default="resource">
<map:reader logger="sitemap.reader.resource" name="resource" pool-max="32" src="org.apache.cocoon.reading.ResourceReader"/>
<map:reader name="jsp" src="org.apache.cocoon.reading.JSPReader"/>
</map:readers>
<!--
Serializers consume SAX events and produce a character stream. Every
pipeline needs to be terminated by a serializer.
-->
<map:serializers default="html">
<map:serializer logger="sitemap.serializer.links" name="links" src="org.apache.cocoon.serialization.LinkSerializer"/>
<map:serializer logger="sitemap.serializer.xml" mime-type="text/xml" name="xml" src="org.apache.cocoon.serialization.XMLSerializer"/>
<map:serializer logger="sitemap.serializer.html" mime-type="text/html" name="html" pool-grow="4" pool-max="32" pool-min="4" src="org.apache.cocoon.serialization.HTMLSerializer">
<buffer-size>1024</buffer-size>
</map:serializer>
<map:serializer logger="sitemap.serializer.vrml" mime-type="model/vrml" name="vrml" src="org.apache.cocoon.serialization.TextSerializer"/>
<map:serializer logger="sitemap.serializer.wml" mime-type="text/vnd.wap.wml" name="wml" src="org.apache.cocoon.serialization.XMLSerializer">
<doctype-public>-//WAPFORUM//DTD WML 1.1//EN</doctype-public>
<doctype-system>http://www.wapforum.org/DTD/wml_1.1.xml</doctype-system>
<encoding>ASCII</encoding>
<omit-xml-declaration>yes</omit-xml-declaration>
</map:serializer>
<map:serializer logger="sitemap.serializer.svgxml" mime-type="image/svg-xml" name="svgxml" src="org.apache.cocoon.serialization.XMLSerializer">
<doctype-public>-//W3C//DTD SVG 20000303 Stylable//EN</doctype-public>
<doctype-system>http://www.w3.org/TR/2000/03/WD-SVG-20000303/</doctype-system>
</map:serializer>
<map:serializer logger="sitemap.serializer.xhtml" mime-type="text/html" name="xhtml" pool-grow="2" pool-max="64" pool-min="2" src="org.apache.cocoon.serialization.XMLSerializer">
<doctype-public>-//W3C//DTD XHTML 1.0 Strict//EN</doctype-public>
<doctype-system>http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</doctype-system>
<encoding>UTF-8</encoding>
</map:serializer>
<map:serializer logger="sitemap.serializer.text" mime-type="text/text" name="text" src="org.apache.cocoon.serialization.TextSerializer"/>
<map:serializer mime-type="application/pdf" name="fo2pdf" src="org.apache.cocoon.serialization.FOPSerializer"/>
<map:serializer mime-type="application/postscript" name="fo2ps" src="org.apache.cocoon.serialization.FOPSerializer"/>
<map:serializer mime-type="vnd.hp-PCL" name="fo2pcl" src="org.apache.cocoon.serialization.FOPSerializer"/>
<map:serializer mime-type="image/jpeg" name="svg2jpeg" src="org.apache.cocoon.serialization.SVGSerializer">
<parameter name="quality" type="float" value="0.9"/>
</map:serializer>
<map:serializer mime-type="image/png" name="svg2png" src="org.apache.cocoon.serialization.SVGSerializer"/>
</map:serializers>
<!--
Matchers are executed during pipeline setup. They decide if a
pipeline fragment is used within a pipeline. Usually, the decision
is based on a match on the requested URI but matchers exist, that
match different things as well. Most often the fragment contained in
a matcher has a generator as well as a serializer. This is not a
necessity, matchers can be nested while chaining does not work.
Related concepts are selectors and actions.
Since this is important, let me repeat it: Matchers are executed
during pipeline setup.
-->
<map:matchers default="wildcard">
<map:matcher logger="sitemap.matcher.wildcard" name="wildcard" src="org.apache.cocoon.matching.WildcardURIMatcher"/>
<map:matcher logger="sitemap.matcher.regexp" name="regexp" src="org.apache.cocoon.matching.RegexpURIMatcher"/>
<map:matcher logger="sitemap.matcher.request-parameter" name="request-parameter" src="org.apache.cocoon.matching.RequestParameterMatcher"/>
<map:matcher logger="sitemap.matcher.cookie" name="cookie" src="org.apache.cocoon.matching.CookieMatcher"/>
<map:matcher logger="sitemap.matcher.header" name="header" src="org.apache.cocoon.matching.HeaderMatcher"/>
<map:matcher logger="sitemap.matcher.parameter" name="parameter" src="org.apache.cocoon.matching.ParameterMatcher"/>
<map:matcher logger="sitemap.matcher.sessionstate" name="sessionstate" src="org.apache.cocoon.matching.WildcardSessionAttributeMatcher">
<attribute-name>org.apache.cocoon.SessionState</attribute-name>
</map:matcher>
<map:matcher logger="sitemap.matcher.next-page" name="next-page" src="org.apache.cocoon.matching.WildcardRequestParameterMatcher">
<parameter-name>next-state</parameter-name>
</map:matcher>
<map:matcher logger="sitemap.matcher.referer-match" name="referer-match" src="org.apache.cocoon.matching.WildcardHeaderMatcher">
<header-name>referer</header-name>
</map:matcher>
</map:matchers>
<!--
Selectors are executed during pipeline setup. They can be used to
determine which pipeline fragments should be combined. They are best
compared with a switch statement in java. Matchers and actions are
related concepts.
Since this is important, let me repeat it: Selectors are executed
during pipeline setup.
-->
<map:selectors default="browser">
<map:selector logger="sitemap.selector.browser" name="browser" src="org.apache.cocoon.selection.BrowserSelector">
<!-- # NOTE: The appearance indicates the search order. This is very important since
# some words may be found in more than one browser description. (MSIE is
# presented as "Mozilla/4.0 (Compatible; MSIE 4.01; ...")
-->
<browser name="explorer" useragent="MSIE"/>
<browser name="pocketexplorer" useragent="MSPIE"/>
<browser name="handweb" useragent="HandHTTP"/>
<browser name="avantgo" useragent="AvantGo"/>
<browser name="imode" useragent="DoCoMo"/>
<browser name="opera" useragent="Opera"/>
<browser name="lynx" useragent="Lynx"/>
<browser name="java" useragent="Java"/>
<browser name="wap" useragent="Nokia"/>
<browser name="wap" useragent="UP"/>
<browser name="wap" useragent="Wapalizer"/>
<browser name="mozilla5" useragent="Mozilla/5"/>
<browser name="mozilla5" useragent="Netscape6/"/>
<browser name="netscape" useragent="Mozilla"/>
</map:selector>
<map:selector logger="sitemap.selector.request-parameter" name="request-parameter" src="org.apache.cocoon.selection.RequestParameterSelector">
<!-- Define now which request parameter to use; or do it later,
when using this selector, via "parameter-name" parameter.
<parameter-name>myparam</parameter-name>
-->
</map:selector>
<map:selector logger="sitemap.selector.request-attribute" name="request-attribute" src="org.apache.cocoon.selection.RequestAttributeSelector">
<!-- <attribute-name>myparam</attribute-name> -->
</map:selector>
<map:selector logger="sitemap.selector.session-attribute" name="session-attribute" src="org.apache.cocoon.selection.SessionAttributeSelector">
<!-- <attribute-name>myparam</attribute-name> -->
</map:selector>
<map:selector logger="sitemap.selector.parameter" name="parameter" src="org.apache.cocoon.selection.ParameterSelector"/>
<map:selector logger="sitemap.selector.header" name="header" src="org.apache.cocoon.selection.HeaderSelector">
<!-- <header-name>myparam</header-name> -->
</map:selector>
<map:selector logger="sitemap.selector.host" name="host" src="org.apache.cocoon.selection.HostSelector"/>
</map:selectors>
<!--
Actions are executed during pipeline setup. Their purpose is to
execute some arbitrary complex code. They are the work horses of
pipelines. Use them to update databases, check external resources
etc. The execution may fail or complete successfully. Only if the
execution was successful, the pipeline fragment contained inside is
used within the pipeline. Related concepts are matchers and
selectors.
Since this is important, let me repeat it: Actions are executed
during pipeline setup.
-->
<map:actions>
<map:action logger="sitemap.action.add-employee" name="add-employee" src="org.apache.cocoon.acting.DatabaseAddAction"/>
<map:action logger="sitemap.action.del-employee" name="del-employee" src="org.apache.cocoon.acting.DatabaseDeleteAction"/>
<map:action logger="sitemap.action.upd-employee" name="upd-employee" src="org.apache.cocoon.acting.DatabaseUpdateAction"/>
<!-- LangSelect action is deprecated. Use LocaleAction instead -->
<!-- Locale Action is moved to /samples/i18n/sitemap.xmap -->
<map:action logger="sitemap.action.request" name="request" src="org.apache.cocoon.acting.RequestParamAction"/>
<map:action logger="sitemap.action.form-validator" name="form-validator" src="org.apache.cocoon.acting.FormValidatorAction"/>
<map:action logger="sitemap.action.session-state" name="session-state" src="org.apache.cocoon.acting.SessionStateAction"/>
<map:action logger="sitemap.action.session-isvalid" name="session-isvalid" src="org.apache.cocoon.acting.SessionIsValidAction"/>
<map:action logger="sitemap.action.resource-exists" name="resource-exists" src="org.apache.cocoon.acting.ResourceExistsAction"/>
<map:action logger="sitemap.action.set-header" name="set-header" src="org.apache.cocoon.acting.HttpHeaderAction"/>
</map:actions>
<!--
The different pipeline implementations
-->
<map:pipelines default="caching">
<map:pipeline name="caching" src="org.apache.cocoon.components.pipeline.impl.CachingProcessingPipeline"/>
<map:pipeline name="noncaching" src="org.apache.cocoon.components.pipeline.impl.NonCachingProcessingPipeline"/>
<!-- The following two can be used for profiling:
<map:pipeline name="profile-caching" src="org.apache.cocoon.components.profiler.ProfilingCachingProcessingPipeline"/>
<map:pipeline name="profile-noncaching" src="org.apache.cocoon.components.profiler.ProfilingNonCachingProcessingPipeline"/>
-->
</map:pipelines>
</map:components>
<!-- =========================== Views =================================== -->
<!--
Views provide diffent, well, views to resources. Views are
orthogonal to pipelines. Please refer to the docs.
-->
<map:views>
<map:view from-label="content" name="content">
<map:serialize type="xml"/>
</map:view>
<map:view from-label="data" name="pretty-content">
<map:transform src="stylesheets/simple-xml2html.xsl"/>
<map:serialize type="html"/>
</map:view>
<map:view from-position="last" name="links">
<map:serialize type="links"/>
</map:view>
</map:views>
<!-- =========================== Resources ================================= -->
<!--
Resources are pipeline fragments that may be used from different
pipeline fragments. For our needs, they behave exactly like
pipelines, only that they are not accessible from outside.
Hence I will explain what's inside below for pipelines.
-->
<map:resources>
<map:resource name="slides">
<map:generate src="docs/samples/slides/slides.xml"/>
<map:transform src="stylesheets/slides/slides-navigation.xsl">
<map:parameter name="use-request-parameters" value="true"/>
<map:parameter name="use-browser-capabilities-db" value="true"/>
</map:transform>
<map:transform src="stylesheets/slides/slides-apachecon.xsl"/>
<map:serialize/>
</map:resource>
<map:resource name="dynamic-page">
<map:generate src="{target}.xsp" type="serverpages"/>
<map:transform src="stylesheets/dynamic-page2html.xsl">
<map:parameter name="view-source" value="{target}.xsp"/>
</map:transform>
<map:serialize/>
</map:resource>
<map:resource name="dynamic-page1">
<!-- print all current sitemap parameters to log -->
<map:act type="session-state">
<map:parameter name="new-state" value="{../0}"/>
<!--
use the complete string that was matched as a parameter. Compare
this with the target parameter below. There the third
sitemap parameter refers to the very same string. Verfy this
by looking at the log. This irritating effect stems from
the fact, that the above map:parameter belongs conceptually
still to the parent element while all other nested tags
are, well, nested.
-->
<map:call resource="dynamic-page">
<map:parameter name="target" value="{../target}/state{../../../0}{../../0}"/>
</map:call>
</map:act>
</map:resource>
<map:resource name="dynamic-page2">
<map:act type="session-state">
<map:parameter name="new-state" value="1"/>
<map:call resource="dynamic-page">
<map:parameter name="target" value="{../target}1"/>
</map:call>
</map:act>
</map:resource>
<map:resource name="simple-page">
<map:generate src="{target}.xml" type="file"/>
<map:transform src="stylesheets/page/simple-page2html.xsl">
<map:parameter name="view-source" value="{target}.xml"/>
</map:transform>
<map:serialize/>
</map:resource>
</map:resources>
<!-- ========================== Action sets ================================ -->
<!--
Action sets group actions together. If some actions are often used
together in pipeline fragments, it's easier to group them and refer
to the group. For more info, please see the docs.
-->
<map:action-sets>
<map:action-set name="employee">
<map:act action="Add" type="add-employee"/>
<map:act action="Delete" type="del-employee"/>
<map:act action="Update" type="upd-employee"/>
</map:action-set>
</map:action-sets>
<!-- =========================== Pipelines ================================= -->
<!--
Pipelines. The beef. Pipelines specify, how the processing of your
content is done. Usually, a pipeline consists of several fragments
that specify the generation, transformation, and serialization of
SAX events.
Processing is done in two steps:
1) The top level elements are executed in order of appearance until
one signals success. These top level elements are usually
matchers. AFAIK other components are not supported for this.
Other components are called depth-first to determine what
fragments make up the processing pipeline. When a component
fails, no nested components are called but the next component on
the same level.
2) Once it is determined which generator, which transformers and
wich serializer is used, these components are executed. During
this, the pipeline may not be changed.
You may have as many pipelines in your sitemap as you like. However,
it seems that the only purposes would be to specify different error
handlers.
-->
<map:pipelines>
<map:global-parameters>
<!-- Define global parameters here -->
</map:global-parameters>
<map:component-configurations>
<!-- Define component configuration here -->
</map:component-configurations>
<!-- MyApp - minimal Cocoon Application Mount -->
<map:pipeline>
<map:match pattern="myapp/**">
<map:mount check-reload="yes" src="myapp/" uri-prefix="myapp"/>
</map:match>
</map:pipeline>
<!-- Cocoon documentation pipeline -->
<map:pipeline>
<map:match pattern="documents/index">
<map:redirect-to uri="index.html"/>
<!--
You may direct a client to a more appropriate URI by the above
command. The above results in a redirect response to the
client. By redirecting to a ressource it would be handled by
cocoon internally.
Since pipelines work on a first match basis, the above wins the
request although the match below would match as well.
-->
</map:match>
<map:match pattern="documents/**">
<map:mount check-reload="yes" src="documentation/" uri-prefix="documents"/>
</map:match>
</map:pipeline>
<map:pipeline id="optional">
<!-- Utility for viewing source xml or html -->
<!-- sample use of regexp equivalent to "**.source" using wildcard
this also shows the '\{' notation to escape sitemap values substitution -->
<map:match pattern="(.*)\.s\{1}ource" type="regexp">
<map:generate src="cocoon:/{1}"/>
<map:transform src="stylesheets/simple-xml2html.xsl"/>
<map:serialize/>
</map:match>
<!-- Below goes entries added by Cocoon build system -->
<!-- XSP pages written in Javascript -->
<map:match pattern="xsp-js/*">
<map:generate src="docs/samples/xsp-js/{1}.xsp" type="serverpages">
<map:parameter name="programming-language" value="js"/>
</map:generate>
<map:transform src="stylesheets/dynamic-page2html.xsl">
<map:parameter name="view-source" value="docs/samples/xsp-js/{1}.xsp"/>
</map:transform>
<map:serialize/>
</map:match>
<!-- ======================= XML:DB ============================== -->
<map:match pattern="xmldb/**">
<map:match pattern="xpath" type="request-parameter">
<map:generate src="xmldb:xindice://localhost:4080/db/{../1}#{1}"/>
<map:serialize type="xml"/>
</map:match>
<map:generate src="xmldb:xindice://localhost:4080/db/{1}"/>
<map:serialize type="xml"/>
</map:match>
</map:pipeline>
<!-- pipeline mounting samples sitemaps -->
<map:pipeline>
<!-- mount other sample pages -->
<map:match pattern="samples/**">
<map:mount check-reload="yes" src="samples/" uri-prefix="samples"/>
</map:match>
</map:pipeline>
<!-- main samples pipeline -->
<map:pipeline>
<map:match pattern="">
<map:generate src="welcome/welcome.xhtml"/>
<map:serialize/>
</map:match>
<map:match pattern="cocoon.gif">
<map:read mime-type="image/gif" src="welcome/cocoon.gif"/>
</map:match>
<map:match pattern="welcome">
<map:generate src="docs/samples/samples.xml"/>
<!--
The first 'real' pipeline. The default generator reads from
"docs/samples/samples.xml" and emits SAX events down the
pipeline. Here, the default generator just reads XML from a file,
parses it and generates SAX events while it does so.
-->
<!--
<map:select>
<map:when test="wap">
<map:transform src="stylesheets/simple-samples2html.xsl"/>
</map:when>
<map:when test="netscape">
<map:transform src="stylesheets/simple-samples2html.xsl"/>
</map:when>
<map:otherwise>
<map:transform src="stylesheets/simple-samples2html.xsl"/>
</map:otherwise>
</map:select>
-->
<map:transform type="xslt" src="stylesheets/simple-samples2html.xsl"/>
<!-- uncomment the following if you want to use Xalan's interpreter as the XSLT processor -->
<!-- <map:transform type="xalan" src="stylesheets/simple-samples2html.xsl"/> -->
<!--
These events are consumed by the default transformer, which
uses "stylesheets/simple-samples2html.xsl" as parameter. Since
here the default transformer is an XSLT transformer, the above
stylesheet is applied. As soon as some of the transformation's
result is determined, new SAX events are emitted down the
pipeline.
-->
<map:serialize/>
<!--
Finally, those SAX events are consumed by the default
serializer, assembling a character stream from them which is
send to the client.
Once a serializer is encountered when assembling the pipeline,
the setup stops and the pipeline is fired up.
-->
</map:match>
<map:match pattern="sample-*">
<map:generate src="docs/samples/sample-{1}.xml"/>
<map:transform src="stylesheets/simple-samples2html.xsl"/>
<map:serialize/>
</map:match>
<map:match pattern="welcome-svg">
<map:generate src="docs/samples/samples.xml"/>
<map:transform src="stylesheets/svg-samples2html.xsl"/>
<map:transform type="extractor"/>
<!--
Here, several transformers are needed to obtain the desired
result. Note, that the above is not the default transformer but
one named "extractor". Interestingly enough, this transformer
does not need any additional configuration or input.
If we look at it's javadocs it says:
"[...] The transformation half of the FragmentExtractor. This
transformer sieves an incoming stream of xml with embedded SVG
images and replaces the images with an xlink locator pointing
to the image. [...]"
So, this interacts with the fragment below, doing the actual
generating.
-->
<map:transform src="stylesheets/fragment-extractor.xsl"/>
<map:serialize/>
</map:match>
<map:match pattern="welcome-svg-images/*.png">
<map:generate src="{1}" type="extractor"/>
<!--
Again, citing the javadocs:
"[...] The generation half of
FragmentExtractor. FragmentExtractor is a transformer-generator
pair which is designed to allow sitemap managers to extract
certain nodes from a SAX stream and move them into a separate
pipeline. The main use for this is to extract inline SVG images
and serve them up through a separate pipeline, usually
serializing them to PNG or JPEG format first. [...]"
-->
<map:serialize type="svg2png"/>
</map:match>
<!-- ================ Hello =========================== -->
<map:match pattern="deli.html">
<map:generate src="docs/samples/hello-page.xml"/>
<map:transform src="stylesheets/deli_test.xsl" type="xslt">
<map:parameter name="use-deli" value="true"/>
</map:transform>
<map:serialize type="html"/>
</map:match>
<map:match pattern="deli.wml">
<map:generate src="docs/samples/hello-page.xml"/>
<map:transform src="stylesheets/deli_test.xsl" type="xslt">
<map:parameter name="use-deli" value="true"/>
</map:transform>
<map:serialize type="wml"/>
</map:match>
<map:match pattern="hello.html">
<map:generate src="docs/samples/hello-page.xml"/>
<map:transform src="stylesheets/page/simple-page2html.xsl"/>
<map:serialize type="html"/>
</map:match>
<map:match pattern="hello.wml">
<map:generate src="docs/samples/hello-page.xml"/>
<map:transform src="stylesheets/page/simple-page2wml.xsl"/>
<map:serialize type="wml"/>
</map:match>
<map:match pattern="hello.vml">
<map:generate src="docs/samples/hello-page.xml"/>
<map:transform src="stylesheets/page/simple-page2vml.xsl"/>
<map:serialize type="xml"/>
</map:match>
<map:match pattern="hello.svg">
<map:generate src="docs/samples/hello-page.xml"/>
<map:transform src="stylesheets/page/simple-page2svg.xsl"/>
<map:serialize type="svg2jpeg"/>
</map:match>
<map:match pattern="hello.wrl">
<map:generate src="docs/samples/hello-page.xml"/>
<map:transform src="stylesheets/page/simple-page2vrml.xsl"/>
<map:serialize type="vrml"/>
</map:match>
<map:match pattern="hello.pdf">
<map:generate src="docs/samples/hello-page.xml"/>
<map:transform src="stylesheets/page/simple-page2fo.xsl"/>
<map:serialize type="fo2pdf"/>
</map:match>
<map:match pattern="redirect">
<map:act type="request">
<map:parameter name="parameters" value="true"/>
<map:redirect-to uri="{dest}"/>
</map:act>
</map:match>
<!-- ================ Sites =========================== -->
<map:match pattern="sites/*.apache.org">
<map:generate src="docs/samples/sites/{1}_apache_org.xml"/>
<map:transform src="stylesheets/sites/{1}_apache_org-html.xsl"/>
<map:serialize/>
</map:match>
<map:match pattern="sites/images/*.gif">
<map:read mime-type="image/gif" src="resources/images/{1}.gif"/>
</map:match>
<!-- ================ NEWS =========================== -->
<map:match pattern="news/slashdot.xml">
<map:generate src="http://slashdot.org/slashdot.xml"/>
<map:transform src="stylesheets/news/slashdot.xsl"/>
<map:serialize/>
</map:match>
<map:match pattern="news/**.gif">
<map:read mime-type="image/gif" src="http://images.slashdot.org/topics/{1}.gif"/>
</map:match>
<map:match pattern="news/**.jpg">
<map:read mime-type="image/jpg" src="http://images.slashdot.org/topics/{1}.jpg"/>
</map:match>
<map:match pattern="news/moreover.xml">
<map:generate src="http://www.moreover.com/cgi-local/page?o=xml&c=Developer%20news"/>
<map:transform src="stylesheets/news/moreover.xsl"/>
<map:serialize/>
</map:match>
<map:match pattern="news/xmlhack.xml">
<map:generate src="http://www.xmlhack.com/cdf.cdf"/>
<map:transform src="stylesheets/news/xmlhack.xsl"/>
<map:serialize/>
</map:match>
<map:match pattern="news/aggregate.xml">
<map:aggregate element="page" ns="http://foo.bar.com/myspace">
<!--
Aggregation is a very powerful concept that allows a document
be generated from several other documents. Strictly speaking,
all parts are just concatenated in this order to a new
document.
Several things to note here:
"cocoon:" is a pseudo protocol and refers to another
pipeline. "cocoon:/" refers to a pipeline from the current
sitemap while "cocoon://" refers to a pipeline from the root
sitemap.
Other pseudo protocols exist:
"context:" is another pseudo protocol, "context://" is
refering to a resource using the servlet context.
"resource:" is yet another pseudo protocol, "resource://" is
refering to a resource from the context classloader.
These pseudo protocols are declared in cocoon.xconf
Thus the parts refer to the pipeline fragments above.
The element attribute places the content in a new root element
named as specified, using the namespace provided by the ns
attribute.
Please see docs for further explanations.
-->
<map:part element="news" ns="http://foo.bar.com/slashdot" src="cocoon:/news/slashdot.xml"/>
<map:part element="news" ns="http://foo.bar.com/moreover" src="cocoon:/news/moreover.xml"/>
<map:part element="news" ns="http://foo.bar.com/xmlhack" src="cocoon:/news/xmlhack.xml"/>
</map:aggregate>
<map:transform src="stylesheets/news/news.xsl"/>
<map:serialize/>
</map:match>
<!-- Aggregation using CInclude transformer -->
<map:match pattern="news/aggregate">
<map:generate src="docs/samples/xsp/aggregate.xsp" type="serverpages"/>
<map:transform type="cinclude"/>
<map:transform src="stylesheets/news/news.xsl"/>
<map:serialize/>
</map:match>
<!-- ============== Catalog ========================== -->
<map:match pattern="**/samples/catalog-demo">
<map:generate src="docs/samples/catalog/test.xml"/>
<map:transform src="docs/samples/catalog/style.xsl"/>
<map:serialize type="html"/>
</map:match>
<map:match pattern="catalog-demo">
<map:generate src="docs/samples/catalog/test.xml"/>
<map:transform src="docs/samples/catalog/style.xsl"/>
<map:serialize type="html"/>
</map:match>
<map:match pattern="sdocbook-demo">
<map:generate src="docs/samples/catalog/article.xml"/>
<map:transform src="docs/samples/catalog/sdocbook2body.xsl"/>
<map:serialize type="html"/>
</map:match>
<!-- ================ Static =========================== -->
<map:match pattern="fo">
<map:generate src="docs/samples/fo/readme.fo"/>
<map:serialize type="fo2pdf"/>
</map:match>
<map:match pattern="svg">
<map:generate src="docs/samples/svg/henryV.svg"/>
<map:serialize type="svg2png"/>
</map:match>
<map:match pattern="scripts/*">
<map:generate src="docs/samples/scripts/{1}" type="script"/>
<map:transform src="stylesheets/page/simple-page2html.xsl"/>
<map:serialize type="html"/>
</map:match>
<map:match pattern="templates/*">
<map:generate src="templates/{1}" type="velocity">
<map:parameter name="name" value="Velocity"/>
<map:parameter name="project" value="Cocoon"/>
</map:generate>
<map:transform src="stylesheets/page/simple-page2html.xsl"/>
<map:serialize type="html"/>
</map:match>
<map:match pattern="slides/slides">
<map:call resource="slides"/>
<!--
To include common pipeline fragments in a pipeline they can be
defined in a resource. Such a resource can be called from
anywhere in your pipeline. Note that this is conceptionally
more like a "goto" because it will never return.
-->
</map:match>
<map:match pattern="slides/">
<map:call resource="slides"/>
</map:match>
<map:match pattern="slides/style">
<map:read mime-type="text/css" src="resources/styles/slides-apachecon.css"/>
</map:match>
<map:match pattern="style">
<map:read mime-type="text/css" src="resources/styles/slides-apachecon.css"/>
</map:match>
<map:match pattern="slides/**.gif">
<map:read mime-type="image/gif" src="docs/samples/{1}.gif"/>
</map:match>
<map:match pattern="slides/**.jpg">
<map:read mime-type="image/jpg" src="docs/samples/{1}.jpg"/>
</map:match>
<map:match pattern="slides/**.png">
<map:read mime-type="image/png" src="docs/samples/{1}.png"/>
</map:match>
<!-- =========================== Dynamic ================================ -->
<map:match pattern="xsp/*">
<map:generate src="docs/samples/xsp/{1}.xsp" type="serverpages"/>
<map:transform src="stylesheets/dynamic-page2html.xsl">
<map:parameter name="view-source" value="docs/samples/xsp/{1}.xsp"/>
<!--
Run-time configuration is done through these
<map:parameter/> elements. Again, let's have a look at the
javadocs:
"[...] All <map:parameter> declarations will be made
available in the XSLT stylesheet as xsl:variables. [...]"
-->
</map:transform>
<map:serialize/>
</map:match>
<map:match pattern="xsp-plain/*">
<map:generate src="docs/samples/xsp/{1}.xsp" type="serverpages"/>
<map:serialize/>
</map:match>
<map:match pattern="sql/*">
<map:generate src="docs/samples/sql/{1}.xml"/>
<map:transform type="sql">
<map:parameter name="use-connection" value="personnel"/>
<!--
Let's have a look at the user docs:
"[...] The purpose of the SQLTransformer is to query a
database and translate the result to XML. [...]"
-->
</map:transform>
<map:transform src="stylesheets/simple-sql2html.xsl"/>
<map:serialize/>
</map:match>
<!-- ========================== Forms ================================= -->
<map:match pattern="forms/employee">
<map:act set="employee">
<map:parameter name="descriptor" value="docs/samples/forms/employee.xml"/>
<!--
Here an action is used. To be precise: all actions that were
grouped together to a set named "employee". See user docs on
actions for more on this.
This fragment until the closing tag of map:act is only
included if at least one action of this set completes
successfully.
-->
<map:generate src="docs/samples/forms/employee.xsp" type="serverpages"/>
<map:transform src="stylesheets/dynamic-page2html.xsl">
<map:parameter name="view-source" value="docs/samples/forms/employee.xsp"/>
</map:transform>
<map:serialize/>
</map:act>
</map:match>
<map:match pattern="forms/*">
<map:generate src="docs/samples/forms/{1}.xsp" type="serverpages"/>
<map:transform src="stylesheets/dynamic-page2html.xsl">
<map:parameter name="view-source" value="docs/samples/forms/{1}.xsp"/>
</map:transform>
<map:serialize/>
</map:match>
<!-- ======================= FormValidation ============================= -->
<map:match pattern="formvalidation/test">
<map:act type="form-validator">
<map:parameter name="descriptor" value="docs/samples/formvalidation/descriptor.xml"/>
<map:parameter name="validate-set" value="car-reservation"/>
<map:call resource="dynamic-page">
<map:parameter name="target" value="docs/samples/formvalidation/OK"/>
</map:call>
</map:act>
<map:call resource="dynamic-page">
<map:parameter name="target" value="docs/samples/formvalidation/ERROR"/>
</map:call>
</map:match>
<!-- ========================== session state ================================= -->
<map:match pattern="session-state/example">
<!--
This example like the next one show, that matches can be
nested and don't need to match on URIs alone. By using a
session attribute or the referer header for matches it is
easy to model a state machine with the sitemap.
There are user documents on this.
-->
<map:act type="session-isvalid">
<!-- if session is valid ... -->
<map:match pattern="1" type="sessionstate">
<!-- if a specific session attribute matches pattern "1" -->
<map:match pattern="1" type="next-page">
<map:call resource="dynamic-page1">
<map:parameter name="target" value="docs/samples/session-state"/>
</map:call>
<!-- by calling this resource, the rest of this fragment here is irrelevant -->
</map:match>
<map:match pattern="2" type="next-page">
<map:call resource="dynamic-page1">
<map:parameter name="target" value="docs/samples/session-state"/>
</map:call>
</map:match>
</map:match>
<map:match pattern="2" type="sessionstate">
<map:match pattern="1" type="next-page">
<map:call resource="dynamic-page1">
<map:parameter name="target" value="docs/samples/session-state"/>
</map:call>
</map:match>
<map:match pattern="2" type="next-page">
<map:call resource="dynamic-page1">
<map:parameter name="target" value="docs/samples/session-state"/>
</map:call>
</map:match>
</map:match>
<map:call resource="dynamic-page2">
<map:parameter name="target" value="docs/samples/session-state/state0"/>
</map:call>
</map:act>
<!-- end if session is valid -->
<map:call resource="dynamic-page">
<map:parameter name="target" value="docs/samples/session-state/start"/>
</map:call>
</map:match>
<!-- ========================== referer ================================= -->
<map:match pattern="referer/*">
<map:match pattern="http://*/cocoon/referer/a" type="referer-match">
<map:call resource="simple-page">
<map:parameter name="target" value="docs/samples/referer/a/{../1}"/>
</map:call>
</map:match>
<map:match pattern="http://*/cocoon/referer/b" type="referer-match">
<map:call resource="simple-page">
<map:parameter name="target" value="docs/samples/referer/b/{../1}"/>
</map:call>
</map:match>
<map:call resource="simple-page">
<map:parameter name="target" value="docs/samples/referer/a/a"/>
</map:call>
</map:match>
<!-- ========================== Stream ================================= -->
<map:match pattern="request1">
<map:generate type="stream">
<map:parameter name="form-name" value="Foo"/>
</map:generate>
<map:serialize type="xml"/>
</map:match>
<map:match pattern="Order">
<map:generate src="docs/samples/stream/OrderPage.xml"/>
<map:transform src="stylesheets/dynamic-page2html.xsl"/>
<map:serialize type="html"/>
</map:match>
<!-- ========================== XSP Sources ============================== -->
<map:match pattern="view-source/*">
<map:read mime-type="text/plain" src="docs/samples/slides/{1}"/>
</map:match>
<map:match pattern="view-source">
<map:generate src="docs/samples/slides/view-source.xsp" type="serverpages"/>
<map:serialize/>
</map:match>
<map:match pattern="view-xsource">
<map:generate src="docs/samples/slides/view-source.xsp" type="serverpages"/>
<map:serialize type="xml"/>
</map:match>
<!-- ========================== SOAP ============================== -->
<map:match pattern="soap/*">
<map:generate src="docs/samples/soap/{1}.xml" type="serverpages"/>
<map:serialize type="xml"/>
</map:match>
<!-- ======================== XScript Samples ========================= -->
<map:match pattern="xscript/soap-getquote1">
<map:generate src="docs/samples/xscript/soap-getquote1.xsp" type="serverpages"/>
<map:transform src="docs/samples/xscript/soap-getquote1.xsl"/>
<map:transform src="stylesheets/dynamic-page2html.xsl">
<map:parameter name="view-source" value="docs/samples/xscript/soap-getquote1.xsp"/>
</map:transform>
<map:serialize/>
</map:match>
<map:match pattern="xscript/*">
<map:generate src="docs/samples/xscript/{1}.xsp" type="serverpages"/>
<map:transform src="stylesheets/dynamic-page2html.xsl">
<map:parameter name="view-source" value="docs/samples/xscript/{1}.xsp"/>
</map:transform>
<map:serialize/>
</map:match>
<!-- ========================== Tidy Samples ============================== -->
<map:match pattern="yahoo">
<map:generate src="http://www.yahoo.com" type="html">
<map:parameter name="xpath" value="/html/body/center/table[1]/tr[1]/td[1]/table[position()=last()]"/>
</map:generate>
<map:transform src="stylesheets/news/news.xsl"/>
<map:serialize type="html"/>
</map:match>
<!-- ========================= Server ================================ -->
<map:match pattern="legacyProfiles/**.rdf">
<map:read mime-type="text/rdf" src="resources/legacyProfiles/{1}.rdf"/>
</map:match>
<map:match pattern="request">
<map:generate type="request"/>
<map:serialize type="xml"/>
</map:match>
<map:match pattern="generror">
<map:generate src="docs/samples/error-giving-page.xml"/>
<map:transform src="stylesheets/simple-samples2html.xsl"/>
<map:serialize/>
</map:match>
<map:match pattern="status">
<map:generate src="status" type="status"/>
<map:transform src="welcome/status2html.xsl"/>
<map:serialize/>
</map:match>
<map:match pattern="sites/styles/**.css">
<map:read mime-type="text/css" src="resources/styles/{1}.css"/>
</map:match>
<map:match pattern="**favicon.ico">
<map:read mime-type="application/ico" src="resources/icons/cocoon.ico"/>
</map:match>
<map:match pattern="images/**.gif">
<map:read mime-type="image/gif" src="resources/images/{1}.gif"/>
</map:match>
<map:match pattern="images/**.jpg">
<map:read mime-type="image/jpg" src="resources/images/{1}.jpg"/>
</map:match>
<map:match pattern="images/**.png">
<map:read mime-type="image/png" src="resources/images/{1}.png"/>
</map:match>
<map:match pattern="**/">
<map:generate src="{1}" type="directory"/>
<map:transform src="stylesheets/system/directory2html.xsl"/>
<map:serialize/>
</map:match>
<map:handle-errors>
<map:transform src="context://stylesheets/system/error2html.xsl"/>
<map:serialize status-code="500"/>
</map:handle-errors>
</map:pipeline>
</map:pipelines>
</map:sitemap><!-- end of file -->
1.1 xml-cocoon2/src/webapp/samples/docs/samples/error-giving-page.xml
Index: error-giving-page.xml
===================================================================
<?xml version="1.0"?>
<!-- CVS: $Id: error-giving-page.xml,v 1.1 2002/07/02 13:06:36 cziegeler Exp $ -->
<!DOCTYPE page [
<!ELEMENT page (title?, content)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT content (para+)>
<!ELEMENT para (#PCDATA)>
]>
<page>
<title>Hello</title>
<content>
</para>This is my first Cocoon page!</para>
</content>
</page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/hello-page.xml
Index: hello-page.xml
===================================================================
<?xml version="1.0"?>
<!-- CVS: $Id: hello-page.xml,v 1.1 2002/07/02 13:06:36 cziegeler Exp $ -->
<!DOCTYPE page [
<!ELEMENT page (title?, content)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT content (para+)>
<!ELEMENT para (#PCDATA)>
]>
<page>
<title>Hello</title>
<content>
<para>This is my first Cocoon page!</para>
</content>
</page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/sample-apps.xml
Index: sample-apps.xml
===================================================================
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- CVS: $Id: sample-apps.xml,v 1.1 2002/07/02 13:06:36 cziegeler Exp $ -->
<samples xmlns:xlink="http://www.w3.org/1999/xlink">
<group name="Back">
<sample name="Back" href="welcome">
Back to samples home page
</sample>
</group>
<group name="Web Applications">
<sample name="Protected Area" href="samples/protected/login">
An example web-application built around db-authenticator,
form-validator, session-validator and session-invalidator
actions.
</sample>
<sample name="Modular Database Actions" href="samples/mod-db/user-list">
An example web-application built around database actions from the
modular package that supports auto increments and more.
</sample>
</group>
<group name="Stateful Applications">
<sample name="Session State" href="session-state/example">
Here the application state is stored in a session attribute.
</sample>
<sample name="Sessionless State" href="referer/a">
Whereas this example uses the request header referer
attribute. The complete URL must be known to the sitemap, so this
works only if you Cocoon's servlet context is /cocoon.
</sample>
</group>
<group name="Sample Forms">
<sample name="Cocoon Feedback Wizard" href="samples/xmlform/wizard.html" xlink:role="dynamic">
Presents a sophisticated form handling demo -
multi page wizard with two way navigation.
Features the
<link href="#XMLForm Doc!">XMLForm</link> framework which provides
<xlink:link href="http://www.w3.org/MarkUp/Forms/">XForms</xlink:link>
based markup,
<xlink:a href="http://www.ascc.net/xml/resource/schematron/schematron.html">Schematron</xlink:a>
instance validation and
automated binding to
<xlink:a href="http://java.sun.com/products/javabeans/">JavaBeans</xlink:a> and
<xlink:a href="http://www.w3.org/DOM/">DOM</xlink:a> instances.
</sample> <sample name="Manage Employees" href="forms/employee" xlink:role="dynamic">
Adds, updates and deletes Employees to the employees table. You should make sure
that you have a database and table according to the docs/samples/sql/sql-page.xml.sql
definitions. Don't forget to change the driver information...
</sample>
<sample name="Insert Department" href="forms/add-department" xlink:role="dynamic">
Adds new Departments to the department table. You should make sure
that you have a database and table according to the docs/samples/sql/sql-page.xml.sql
definitions. Don't forget to change the driver information...
</sample>
<sample name="Insert Employees" href="forms/add-employee" xlink:role="dynamic">
Adds new Employees to the employees table. You should make sure
that you have a database and table according to the docs/samples/sql/sql-page.xml.sql
definitions. Don't forget to change the driver information...
</sample>
<sample name="Form Validation" href="formvalidation/test" xlink:role="dynamic">
This example demonstrates the use of an action to validate user
input and report validation errors to the user through a taglib.
</sample>
</group>
</samples>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/sample-dynamic.xml
Index: sample-dynamic.xml
===================================================================
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- CVS: $Id: sample-dynamic.xml,v 1.1 2002/07/02 13:06:36 cziegeler Exp $ -->
<samples xmlns:xlink="http://www.w3.org/1999/xlink">
<group name="Back">
<sample name="Back" href="welcome">
Back to samples home page
</sample>
</group>
<group name="Internationalization">
<sample name="Simple Internationalization" href="i18n/simple.xml">
Sample for Internationalization.
</sample>
<sample name="XSP Internationalization" href="i18n/simple.xsp">
Sample for Internationalization in an XSP.
</sample>
</group>
<group name="Dynamic Content">
<sample name="Javascript Generator" href="scripts/hello.js">
An example of the ScriptGenerator producing XML out of a Javascript program.
</sample>
<sample name="Python Generator" href="scripts/hello.py">
An example of the ScriptGenerator producing XML out of a Python program.
ATTENTION: This example will not work unless you have put the Jython
interpreter (jython.jar) from www.jython.org in the WEB-INF/lib directory
of your Cocoon webapp context.
</sample>
<sample name="Velocity Generator" href="templates/hello-page.vm">
An example of the VelocityGenerator producing XML out of a Velocity Template.
</sample>
<sample name="Parameterised Redirect" href="redirect?dest=http://xml.apache.org/">
An example of redirecting a client based on a request parameter.
</sample>
<sample name="Yahoo Screen Scrape" href="yahoo">
An example of HTML Generator scraping a part of the Yahoo main page.
</sample>
<!-- FIX ME
<sample name="Parent Component Manager" href="parentcm">
An example showing the use of a parent component manager. For this sample to work,
Cocoon must have been built with the include.webapp.libs flag set to true. (Otherwise
the sample classes are not found.)
</sample>
-->
</group>
<group name="XScript and SOAP">
<sample name="Simple Sample" href="xscript/simple">
A simple sample for XScript.
</sample>
<sample name="SOAP Stock Quote Example 1" href="xscript/soap-getquote1">
This page demonstrates the SOAP logicsheet for
Cocoon. It accesses a SOAP service that provides stock quotes
and displays the result.
</sample>
<sample name="SOAP Sample 2" href="xscript/soap-getquote2">
This example uses an inline XSLT stylesheet and an
XScript transform instruction to extract the stock
price.
</sample>
<sample name="SOAP Sample 3" href="xscript/soap-getquote3">
This is yet another example of the XScript and SOAP
logicsheets. This sample is very similar with
SOAP Sample 2, except that the stylesheet is defined in an external file.
</sample>
</group>
<group name="Database Access">
<sample name="Simple SQL" href="sql/sql-page" xlink:role="dynamic">
Simple SQL example. You should make sure that you have a database and
table according to the conf/sitemap.xmap and the
docs/samples/sql/sql-page.xml.sql definitions.
</sample>
<sample name="ESQL" href="xsp/esql" xlink:role="dynamic">
Simple example of the ESQL logicsheet.
</sample>
</group>
<group name="Aggregation Sample">
<sample name="Slashdot" href="news/slashdot.xml">
Live XML Feed from Slashdot.
</sample>
<sample name="Moreover.com" href="news/moreover.xml">
Live XML Developer News Feed from moreover.com.
</sample>
<sample name="XMLHack.com" href="news/xmlhack.xml">
Live Channel Feed from XMLHack.com.
</sample>
<sample name="Aggregation" href="news/aggregate.xml">
Single Web Page with News from all sources above aggregated by
the sitemap.
</sample>
<sample name="Aggregation" href="news/aggregate">
Single Web Page with News from all sources above aggregated by
include transformer.
</sample>
</group>
</samples>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/sample-static.xml
Index: sample-static.xml
===================================================================
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- CVS: $Id: sample-static.xml,v 1.1 2002/07/02 13:06:36 cziegeler Exp $ -->
<samples xmlns:xlink="http://www.w3.org/1999/xlink">
<group name="Back">
<sample name="Back" href="welcome">
Back to samples home page
</sample>
</group>
<group name="XML-ized web sites">
<sample name="java.apache.org" href="sites/java.apache.org">
This page shows a much more complex example that shows how powerful
is the style separation and how powerful XML+XSLT can be even for
web publishing.
</sample>
<sample name="jakarta.apache.org" href="sites/jakarta.apache.org">
This pages shows the XML-ized version of the Apache Jakarta web site.
</sample>
</group>
<group name="XML Entity Catalogs">
<sample name="Entity Resolution Using Catalogs" href="catalog-demo">
External entities (e.g. DTDs, symbols, character entity sets, images) are
resolved to local copies of the resources. The catalog manager facilitates
the mapping between public identifiers or system identifiers and other
system identifiers.
</sample>
</group>
<group name="CC/PP and UAProf">
<sample name="Quick Start" href="documents/developing/deliquick.html">
Read this to find out how to enable DELI before trying the test pages.
</sample>
<sample name="DELI" href="deli.html">
Test page for HTML clients.
</sample>
<sample name="DELI" href="deli.wml">
Test page for WAP clients.
</sample>
</group>
<group name="Static Content">
<sample name="Formatting Objects" href="fo">
This is an example of XML-FO document translated into PDF by Apache FOP.
</sample>
<sample name="Scalable Vector Graphics" href="svg">
An example of an SVG document rendered into a PNG image.
</sample>
<sample name="SVG Welcome Page" href="welcome-svg">
A version of this page rendered as a series of SVG
images embedded within an HTML page. This example
uses the 'fragment extractor' transformer and generator
to automatically extract the images and feed them through
a separate pipeline.
</sample>
</group>
</samples>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/sample-xsp.xml
Index: sample-xsp.xml
===================================================================
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- CVS: $Id: sample-xsp.xml,v 1.1 2002/07/02 13:06:36 cziegeler Exp $ -->
<samples xmlns:xlink="http://www.w3.org/1999/xlink">
<group name="Back">
<sample name="Back" href="welcome">
Back to samples home page.
</sample>
</group>
<group name="Hello, XSP">
<sample name="Hello Page" href="xsp/hello">
Dynamically generated hello page.
</sample>
<sample name="Logicsheet" href="xsp/logicsheet">
Greetings page with logic separated into logicsheet.
</sample>
<sample name="Cacheable" href="xsp/cacheable">
Cacheable XSP page.
</sample>
</group>
<group name="Java Server Pages">
<note>
Note: Depending on your servlet engine, this example might not work directly.
For more information on how to configure the JSP components please refer to the
documentation.
</note>
<sample name="JSP Generator" href="jsp/hello">
An example of the JSPGenerator producing XML out of using JSP.
</sample>
<sample name="JSP Reader" href="jsp/welcome.htm">
An example of the JSPReader producing HTML out of using JSP.
</sample>
</group>
<group name="eXtensible Server Pages in Java">
<sample name="Simple XSP" href="xsp/simple">
Simple XSP example showing usage of several logicsheets.
</sample>
<sample name="ESQL" href="xsp/esql" xlink:role="dynamic">
Simple example of the ESQL logicsheet.
</sample>
<sample name="Session XSP" href="xsp/sessionpage" xlink:role="dynamic">
Sample Session XSP to illustrate session handling.
</sample>
<sample name="File Uploads" href="xsp/upload" xlink:role="dynamic">
Sample to illustrate file uploads.
</sample>
<sample name="Request" href="xsp/request" xlink:role="dynamic">
Request logicsheet tests.
</sample>
<sample name="Response" href="xsp/response" xlink:role="dynamic">
Response logicsheet tests.
</sample>
<sample name="Session" href="xsp/session" xlink:role="dynamic">
Session logicsheet tests.
</sample>
<sample name="Cookie" href="xsp/cookie" xlink:role="dynamic">
Cookies logicsheet tests.
</sample>
<sample name="Util" href="xsp/resolver" xlink:role="dynamic">
Util logicsheet tests.
</sample>
</group>
<group name="eXtensible Server Pages in Javascript">
<sample name="Hello" href="xsp-js/hello">
Hello in Javascript
</sample>
<sample name="Simple" href="xsp-js/simple" xlink:role="dynamic">
Another simple XSP example.
</sample>
<sample name="Request" href="xsp-js/request" xlink:role="dynamic">
Request logicsheet tests (same as in Java).
</sample>
<sample name="Response" href="xsp-js/response" xlink:role="dynamic">
Response logicsheet tests (same as in Java).
</sample>
<sample name="Session" href="xsp-js/session" xlink:role="dynamic">
Session logicsheet tests (same as in Java).
</sample>
</group>
<group name="eXtensible Server Pages in Python">
<sample name="Hello" href="xsp-py/hello">
Hello in Python
</sample>
</group>
</samples>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/samples.xml
Index: samples.xml
===================================================================
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- CVS: $Id: samples.xml,v 1.1 2002/07/02 13:06:36 cziegeler Exp $ -->
<samples xmlns:xlink="http://www.w3.org/1999/xlink">
<group name="Multimedia Hello World">
<sample name="HTML" href="hello.html">
This is a very simple demonstration of how to use Cocoon. A simple XML page
is transformed into an HTML page.
</sample>
<sample name="WML" href="hello.wml">
Now something more juicy: the exact same page is translated into WAP WML.
</sample>
<sample name="VoxML" href="hello.vml">
Maybe you have your hands busy? with VoxML you don't need hands, just your voice.
</sample>
<sample name="SVG" href="hello.svg">
Need a fancier look? No problem, SVG is your friend.
</sample>
<sample name="VRML" href="hello.wrl">
Need more space? Well, not really useful in this case, but VRML may come handy.
</sample>
<sample name="PDF" href="hello.pdf">
Printed HTML sucks? Don't worry, your friend Cocoon gives you a nice PDF.
</sample>
</group>
<group name="Documentation">
<sample name="Docs" href="documents/index">
The Cocoon documentation.
</sample>
<sample name="Tutorial" href="tutorial/home.html">
A tutorial on Cocoon.
</sample>
<sample name="List of docs" href="documents/doclist.html">
Generated list of all documentation (aggregates each book.xml)
</sample>
<sample name="Slides" href="slides/slides">
Presentation of Cocoon 1 shown at ApacheCon 2000. (Example of complex XSLT usage)
</sample>
<sample name="Search the docs" href="samples/search/welcome">
Search into the cocoon documentation using Apache Lucene.
</sample>
</group>
<group name="More Samples">
<sample name="Static Content" href="sample-static">
How to produce different type of static content.
</sample>
<sample name="Server Pages" href="sample-xsp">
Dynamic content implemented in XSP pages.
</sample>
<sample name="Dynamic Content" href="sample-dynamic">
More ways of implementing dynamic content.
</sample>
<sample name="Authentication Framework" href="samples/authentication/login">
This is a demo of the authentication framework integrated into Cocoon.
</sample>
<sample name="Portal Framework" href="samples/portal/sunspotdemoportal">
This is a demo of the portal framework integrated into Cocoon.
</sample>
<sample name="Sources" href="samples/sub/">
Samples showing possible ways how to use Cocoon sources in sitemap.
(These samples are served by sub-sitemap)
</sample>
<sample name="Web Applications" href="sample-apps">
Samples showing how to perform form processing, state management,
and simple web-application with login and protected resources.
</sample>
<sample name="Legacy file formats" href="samples/poi/">
Samples showing how to use Apache POI to use common office file formats
with Cocoon.
</sample>
</group>
<group name="System Tools And Pages">
<!-- sample name="Sitemap Editor" href="sitebuilder/openSubSite/">
Cocoon/JSP based Sitemap Editor.
</sample -->
<sample name="Status Page" href="status">
Cocoon status page.
</sample>
<sample name="Request Page" href="request">
This example shows the usage of the RequestGenerator.
</sample>
<sample name="Error Page" href="generror">
This example shows what happens if an error is triggered in the pipeline.
</sample>
</group>
</samples>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/fo/readme.fo
Index: readme.fo
===================================================================
<?xml version="1.0" encoding="utf-8"?>
<!--
THIS IS NOT THE LATEST VERSION OF THE FOP DOCUMENTATION BUT ONLY AN EXAMPLE FILE
This files shows next to the trivial usage of fo:block and fo:inline examples of
- fo:basic-link external-destination
- fo:basic-link internal-destination
- fo:table
- fo:list-block (including a bullet from the font Symbol as list-item-label)
- fo:page-number-citation (computes dynamically the page number in section 'content')
-->
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<!-- layout for the first page -->
<fo:simple-page-master master-name="first"
page-height="29.7cm"
page-width="21cm"
margin-top="1cm"
margin-bottom="2cm"
margin-left="2.5cm"
margin-right="2.5cm">
<fo:region-body margin-top="3cm"/>
<fo:region-before extent="3cm"/>
<fo:region-after extent="1.5cm"/>
</fo:simple-page-master>
<!-- layout for the other pages -->
<fo:simple-page-master master-name="rest"
page-height="29.7cm"
page-width="21cm"
margin-top="1cm"
margin-bottom="2cm"
margin-left="2.5cm"
margin-right="2.5cm">
<fo:region-body margin-top="2.5cm"/>
<fo:region-before extent="2.5cm"/>
<fo:region-after extent="1.5cm"/>
</fo:simple-page-master>
<fo:page-sequence-master master-name="basicPSM" >
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference master-reference="first"
page-position="first" />
<fo:conditional-page-master-reference master-reference="rest"
page-position="rest" />
<!-- recommended fallback procedure -->
<fo:conditional-page-master-reference master-reference="rest" />
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
</fo:layout-master-set>
<!-- end: defines page layout -->
<!-- actual layout -->
<fo:page-sequence master-reference="basicPSM">
<fo:static-content flow-name="xsl-region-before">
<fo:block text-align="end" font-size="10pt" font-family="serif" line-height="14pt" color="red" >
This is not the latest Fop documentation, but just an fo example. FOP - p. <fo:page-number/>
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block font-size="18pt" font-family="sans-serif" line-height="24pt" space-after.optimum="15pt" background-color="blue" color="white" text-align="center" padding-top="3pt">FOP: An Open-Source XSL Formatter and Renderer</fo:block>
<fo:block id="sec1" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >A)
What is FOP?</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">FOP is the world's first print formatter driven by XSL formatting
objects. It is a Java 1.1 application that reads a formatting object
tree and then turns it into a PDF document. The formatting object
tree, can be in the form of an XML document (output by an XSLT engine
like XT or Xalan) or can be passed in memory as a DOM Document or (in
the case of XT) SAX events.
</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">FOP is part of Apache's XML project. The homepage of FOP is
<fo:inline font-style="italic" font-family="serif"><fo:basic-link color="blue" external-destination="http://xml.apache.org/fop">http://xml.apache.org/fop</fo:basic-link></fo:inline>
</fo:block>
<fo:block id="sec2" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >B)
Downloading FOP</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">The latest release version is <fo:inline font-style="italic" font-family="serif">FOP
0.20</fo:inline> <fo:inline font-family="serif">
()
</fo:inline>. </fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">NOTE: you do not have to unjar or unzip this jar file.</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">Documentation can be downloaded here as <fo:inline font-style="italic" font-family="serif">HMTL file</fo:inline>
<fo:inline font-family="serif">
()
</fo:inline> or
as <fo:inline font-style="italic" font-family="serif">PDF file</fo:inline>
<fo:inline font-family="serif">
()
</fo:inline>.</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">To run FOP from the command line, see Running FOP. If you are interested in
embedding FOP in a Java application of your own, see Embedding FOP.
</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">You can also download the <fo:inline font-style="italic" font-family="serif">source code v. 0.14</fo:inline>
<fo:inline font-family="serif">
()
</fo:inline> as jar file</fo:block>
<fo:block id="sec3" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >C)
Running FOP</fo:block>
<fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >1) Prerequisites</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">Following software must be installed:</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">a) Java 1.1.x or later</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">For the fo-file viewer mode of FOP (see below) you must have the swing classes installed.
From Java 1.2 on (aka Java 2) they are part of the standard java distribution.
If you use Java 1.1.x you must seperately include the swing classes, which can
be found at the <fo:inline font-style="italic" font-family="serif">
Sun website</fo:inline>
<fo:inline font-family="serif">
(http://java.sun.com/products/jfc/#download-swing)
</fo:inline>.
</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">b) An XML parser which supports SAX and DOM like
<fo:inline font-style="italic" font-family="serif">Xerces-J</fo:inline>
<fo:inline font-family="serif">
(http://xml.apache.org/xerces-j/index.html)
</fo:inline>.</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">c) If you have to produce the flow objects files, which are the input for FOP,
you need a transformation utility to create this files from your xml files.
Normally this is an XSLT stylesheet processor like
<fo:inline font-style="italic" font-family="serif">XT</fo:inline>
<fo:inline font-family="serif">
(http://www.jclark.com/xml/xt.html)
</fo:inline>
or <fo:inline font-style="italic" font-family="serif">XALAN</fo:inline>
<fo:inline font-family="serif">
(http://xml.apache.org/xalan/index.html)
</fo:inline>.
</fo:block>
<fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >2) Starting FOP as an standalone application</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">There are three ways to run FOP from the command line.</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">a) Batch processing formatting objects (fo) files: </fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java org.apache.fop.apps.CommandLine fo-file pdf-file</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">b) Batch processing xml files (includes production of the fo-files):</fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java org.apache.fop.apps.CommandLine xml-file xsl-file pdf-file</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">c) Previewing the fo-file:</fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java org.apache.fop.apps.AWTCommandLine fo-file</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">Each method uses next to the fop classes other packages. The following describes
each method in detail.</fo:block>
<fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >a) Method One</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">One is to first use an XSLT engine to produce the formatting object tree as an
XML document and then running the class org.apache.fop.apps.CommandLine with the
formatting object file name and PDF filename as arguments. You will need to include
FOP and your XML Parser in your classpath and so you might invoke
</fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java -cp fop_x_xx_x.jar;xerces.jar</fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">org.apache.fop.apps.CommandLine fo-file pdf-file</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">If your SAX Parser is other than Xerces, you will need to set the property
org.xml.sax.parser to the SAX Parser class to use. The following example shows
the command line, if you use XP, the XML parser from James Clark:
</fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java -Dorg.xml.sax.parser=com.jclark.xml.sax.Driver</fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">-cp fop_x_xx_x.jar;sax.jar;xt.jar;xp.jar;xerces.jar</fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">org.apache.fop.apps.AWTCommandLine formatting-tree-file pdf-file</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">(You have to include xerces.jar or another xml parser which supports DOM in your classpath.) </fo:block>
<fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >b) Method Two</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">Rather than performing transformation with an XSLT before invoking FOP, it is
possible, if you use XT as your XSLT engine, to just call FOP and have it call
XT for you. To do this, run the class org.apache.fop.apps.CommandLine with the
source XML file name, XSL file name and PDF file name as arguments. You will
need to include FOP, SAX, your SAX Parser and XT in your classpath and so you might
invoke
</fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java -Dorg.xml.sax.parser=com.jclark.xml.sax.Driver</fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">-cp fop_x_xx_x.jar;xt.jar;xerces.jar</fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">org.apache.fop.apps.CommandLine xml-file xsl-file pdf-file</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">Again, if your SAX Parser is other than Xerces, you will need to set the property
org.xml.sax.parser to the SAX Parser class to use.
</fo:block>
<fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >c) Method Three</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">If you already produced the FO file, you can preview the results of your
transformation without using any pdf viewer by invoking FOP with the viewer
application. You will need to include FOP and your XML Parser in your classpath
</fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java -cp fop_x_xx_x.jar;xerces.jar</fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">org.apache.fop.apps.AWTCommandLine fo-file </fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">The viewer uses the swing classes.</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">Note: If you are using java 2 or later (i.e. jdk 1.2. or later) you can put all
needed jar files into the subdirectory jdk1.2.x\jre\lib\ext (windows example). Then
FOP can be started without classpath:
</fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java org.apache.fop.apps.CommandLine fo-file pdf-file</fo:block>
<fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >3) Running FOP on MacOS</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">Ensure that you have a recent MRJ, and that you have downloaded and
unpacked the XP and SAX distributions. The xp.jar and sax.jar files work
as is on MacOS.
</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">Drag the FOP jarfile onto the JBindery icon. When the first dialog
appears, type "org.apache.fop.apps.CommandLine" in the "Class name" field.
Using UNIX syntax, type the names of the input formatting-object file and
the output PDF in the "Optional parameters" field.
</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">Click on the Classpath icon. To add the xp.jar and sax.jar files, click
the "Add .zip file" button, navigate to the file in question, and click
Open.
</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">Once both are added (the FOP jarfile will already be in the list), click
Run. A "stdout" window will appear and display FOP runtime messages.
</fo:block>
<fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >4) Problems</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">If you have problems running FOP, please have a look at the
<fo:inline font-style="italic" font-family="serif">FOP FAQ</fo:inline>
<fo:inline font-family="serif">
(faq.html)
</fo:inline>. If you don't find a solution there,
you can ask for help on the list fop-dev@xml.apache.org. Maybe it's bug and
maybe somebody is already working on it.
</fo:block>
<fo:block id="sec4" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >D)
Embedding FOP </fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">Instantiate org.apache.fop.apps.Driver. Once this class is
instantiated, methods are called to set the
Renderer to use, the (possibly multiple) ElementMapping(s) to
use and the PrintWriter to use to output the results of the
rendering (where applicable). In the case of the Renderer and
ElementMapping(s), the Driver may be supplied either with the
object itself, or the name of the class, in which case Driver will
instantiate the class itself. The advantage of the latter is it
enables runtime determination of Renderer and ElementMapping(s).
</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">Once the Driver is set up, the buildFOTree method
is called. Depending on whether DOM or SAX is being used, the
invocation of the method is either buildFOTree(Document) or
buildFOTree(Parser, InputSource) respectively.
</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">A third possibility may be used to build the FO Tree, namely
calling getDocumentHandler() and firing the SAX events yourself.
</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">Once the FO Tree is built, the format() and render() methods may be
called in that order.
</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">Here is an example use of Driver from CommandLine.java:</fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">Driver driver = new Driver();</fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.setRenderer("org.apache.fop.render.pdf.PDFRenderer", version);</fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.addElementMapping("org.apache.fop.fo.StandardElementMapping");</fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.addElementMapping("org.apache.fop.svg.SVGElementMapping");</fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.setWriter(new PrintWriter(new FileWriter(args[1])));</fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.buildFOTree(parser, fileInputSource(args[0]));</fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.format();</fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.render();</fo:block>
<fo:block id="sec5" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >E)
What's Implemented?</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">Also see STATUS for what is being worked on.</fo:block>
<fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >1) Formatting Objects</fo:block>
<fo:list-block start-indent="1cm" provisional-distance-between-starts="12pt" font-family="serif">
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>root </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>layout-master-set </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>simple-page-master </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>region-body </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>region-before </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>region-after </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>page-sequence </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>sequence-specification </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>sequence-specifier-single </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>sequence-specifier-repeating </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>sequence-specifier-alternating </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>flow </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>static-content </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>block </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>list-block </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>list-item </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>list-item-label </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>list-item-body </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>page-number </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>display-sequence </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>inline </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>display-rule </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>display-graphic </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>table (minimal support)</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>table-column (minimal support)</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>table-body (minimal support)</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>table-row (minimal support)</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>table-cell (minimal support)</fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
<fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >2) Properties</fo:block>
<fo:list-block start-indent="1cm" provisional-distance-between-starts="12pt" font-family="serif">
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>end-indent </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>page-master-name </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>page-master-first </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>page-master-repeating </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>page-master-odd </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>page-master-even </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>margin-top (only on pages and regions)</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>margin-bottom (only on pages and regions)</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>margin-left (only on pages and regions)</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>margin-right (only on pages and regions)</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>extent </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>page-width </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>page-height </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>flow-name </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>font-family </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>font-style </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>font-weight </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>font-size </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>line-height </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>text-align </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>text-align-last </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>space-before.optimum </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>space-after.optimum </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>start-indent </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>end-indent </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>provisional-distance-between-starts </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>provisional-label-separation </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>rule-thickness </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>color </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>wrap-option </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>white-space-treatment </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>break-before </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>break-after </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>text-indent </fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>href</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>column-width</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>background-color</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>padding-top (only in conjunction with background color)</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>padding-left (only in conjunction with background color)</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>padding-bottom (only in conjunction with background color)</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>padding-right (only in conjunction with background color)</fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
<fo:block id="sec6" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >F)
Limitations</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">Although FOP implements the above listed fo objects and properties, sometimes it does so
only in a limited way.
</fo:block>
<fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >list-block</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">The fo working draft allows describes two ways to markup lists.The list-block must have as
children either: 1) pairs of fo:list-item-label and fo:list-item-body formatting objects, or
2) fo:list-item formatting objects.</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">At the moment FOP only implements the second way. Therefore a list has a basic structure like this:</fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"><fo:list-block></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"><fo:list-item></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"><fo:list-item-label><fo:block></fo:block></fo:list-item-label></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"><fo:list-item-body><fo:block></fo:block></fo:list-item-body></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"></fo:list-item></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"></fo:list-block></fo:block>
<fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >Padding</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">Padding works in conjunction with indents and spaces. It is only implemented
for blocks. At the moment padding can't be used to make extra space (indents+spaces
must be used), but only to control how much the background-color extends beyond
the content rectangle.
</fo:block>
<fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >Tables</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">There two limitations for tables: 1) FOP needs you to explicitly specify column widths
2) Cells have to contain block-level FOs. They can't contain straight character data.
</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">A working basic example of a table looks like this: </fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"><fo:table></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-column column-width="150pt"/></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-column column-width="150pt"/></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-body font-size="10pt" font-family="sans-serif"></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-row></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-cell></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:block>text</fo:block></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-cell></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-cell></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:block>text</fo:block></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-cell></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-row></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-row></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-cell></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:block>text</fo:block></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-cell></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-cell></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:block>text</fo:block></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-cell></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-row></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-row></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-cell></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:block>text</fo:block></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-cell></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-cell></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:block>text</fo:block></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-cell></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-row></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-body></fo:block>
<fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"></fo:table></fo:block>
<fo:block id="sec7" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >G)
Bugs</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">see STATUS file</fo:block>
<fo:block id="sec8" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >H)
Compiling FOP</fo:block>
<fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >1. Prerequisites</fo:block>
<fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >a) Java 1.1.x or later</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">If you use Java 1.1.x you must also seperately include the swing classes, which can
be found at the <fo:inline font-style="italic" font-family="serif">
Sun website</fo:inline>
<fo:inline font-family="serif">
(http://java.sun.com/products/jfc/#download-swing)
</fo:inline>. From Java 1.2 on (aka Java 2) they are part of the standard
distribution.
</fo:block>
<fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >b) An XML parser</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">An XML parser which supports DOM like
<fo:inline font-style="italic" font-family="serif">Xerces-J</fo:inline>
<fo:inline font-family="serif">
(http://xml.apache.org/xerces-j/index.html)
</fo:inline>.</fo:block>
<fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >c) XT from James Clark</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">Some of the Java source code in FOP is generated from XML using
XSLT. XT must be used to generate this code.</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">XT is an XSL stylesheet processor written in java. At the moment you
can't use any other processor, because the make file makes use of some
proprietary features of Clark's xt which allow to write output in more
then one document. You can find XT at <fo:inline font-style="italic" font-family="serif">
James Clark's website</fo:inline>
<fo:inline font-family="serif">
(http://www.jclark.com/xml/xt.html)
</fo:inline>. You have to use XT version 19991105 or later.</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">(Under windows you shouldn't use the prepackaged xt.exe but also the
generic jar file, otherwise make won't work)
</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">XT relies on an sax parser like XP (also J. Clark), which can be
downloaded at <fo:inline font-style="italic" font-family="serif">James
Clark's Website</fo:inline>
<fo:inline font-family="serif">
(http://www.jclark.com/xml/xp/index.html)
</fo:inline>
</fo:block>
<fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >d) make</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">Under windows it has been reported that the use of the cygnus solutions port
of the GNU utilities works. You can find it at
<fo:inline font-style="italic" font-family="serif">Cygnus Solutions</fo:inline>
<fo:inline font-family="serif">
(http://sourceware.cygnus.com/cygwin/)
</fo:inline>
</fo:block>
<fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >Compiling FOP on MacOS</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">We strongly recommend the use of Codewarrior Java. This Readme will
contain a link to more information in the near future.
</fo:block>
<fo:block id="sec9" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >I)
Getting involved</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">1. Subscribe to fop-dev@xml.apache.org by sending an email
to fop-dev-subscribe@xml.apache.org</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">2. Read the archives to fop-dev to get an idea of the issues being
discussed. </fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">3. Subscribe to fop-cvs@xml.apache.org by sending an email to
fop-cvs-subscribe@xml.apache.org (it is important
that you follow changes being made). </fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">4. Try :-) to wrap your head around the XSL working draft. </fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">5. Get CVS working on your system. </fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">6. Ask, on fop-dev, any questions you have at all about the code, design, etc. </fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">7. When you feel comfortable modifying the code, send diffs to
fop-dev with your contributions. </fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">8. Have fun!</fo:block>
<fo:block id="sec10" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >J)
FOP Relevant Specifications</fo:block>
<fo:list-block start-indent="1cm" provisional-distance-between-starts="12pt" font-family="serif">
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<fo:inline font-style="italic" font-family="serif">XML Recommendation</fo:inline>
<fo:inline font-family="serif" >
(<fo:basic-link color="blue" external-destination="http://www.w3.org/TR/REC-xml">http://www.w3.org/TR/REC-xml</fo:basic-link>)
</fo:inline>
</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<fo:inline font-style="italic" font-family="serif">XSL-FO Working Draft</fo:inline>
<fo:inline font-family="serif">
(<fo:basic-link color="blue" external-destination="http://www.w3.org/TR/WD-xsl/">http://www.w3.org/TR/WD-xsl/</fo:basic-link>)
</fo:inline>
</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<fo:inline font-style="italic" font-family="serif">XSLT Recommendation</fo:inline>
<fo:inline font-family="serif">
(<fo:basic-link color="blue" external-destination="http://www.w3.org/TR/xslt">http://www.w3.org/TR/xslt</fo:basic-link>)
</fo:inline>
</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<fo:inline font-style="italic" font-family="serif">PDF Documentation</fo:inline>
<fo:inline font-family="serif">
(<fo:basic-link color="blue" external-destination="http://partners.adobe.com/asn/developer/acrosdk/DOCS/pdfspec.pdf">http://partners.adobe.com/asn/developer/acrosdk/DOCS/pdfspec.pdf</fo:basic-link>)
</fo:inline>
</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<fo:inline font-style="italic" font-family="serif">Simple API for XML (SAX)</fo:inline>
<fo:inline font-family="serif">
(<fo:basic-link color="blue" external-destination="http://www.megginson.com/SAX/">http://www.megginson.com/SAX/</fo:basic-link>)
</fo:inline>
</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<fo:inline font-style="italic" font-family="serif">Document Object Model (DOM)</fo:inline>
<fo:inline font-family="serif">
(<fo:basic-link color="blue" external-destination="http://www.w3.org/TR/REC-DOM-Level-1">http://www.w3.org/TR/REC-DOM-Level-1</fo:basic-link>)
</fo:inline>
</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<fo:inline font-style="italic" font-family="serif">Namespaces in XML Recommendation</fo:inline>
<fo:inline font-family="serif">
(<fo:basic-link color="blue" external-destination="http://www.w3.org/TR/REC-xml-names/">http://www.w3.org/TR/REC-xml-names/</fo:basic-link>)
</fo:inline>
</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-family="Symbol">·</fo:inline></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<fo:inline font-style="italic" font-family="serif">Java JDK 1.1 Documentation</fo:inline>
<fo:inline font-family="serif">
(<fo:basic-link color="blue" external-destination="http://java.sun.com/products/jdk/1.1/docs/index.html">http://java.sun.com/products/jdk/1.1/docs/index.html</fo:basic-link>)
</fo:inline>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
<fo:block id="sec11" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >K)
Licence</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif"> ============================================================================</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif"> The Apache Software License, Version 1.1</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif"> ============================================================================</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif"> Copyright (C) 1999 The Apache Software Foundation. All rights reserved.</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif"> Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">3. The end-user documentation included with the redistribution, if any, must
include the following acknowledgment: "This product includes software
developed by the Apache Software Foundation (http://www.apache.org/)."
Alternately, this acknowledgment may appear in the software itself, if
and wherever such third-party acknowledgments normally appear.
</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">4. The names "FOP" and "Apache Software Foundation" must not be used to
endorse or promote products derived from this software without prior
written permission. For written permission, please contact
apache@apache.org.
</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">5. Products derived from this software may not be called "Apache", nor may
"Apache" appear in their name, without prior written permission of the
Apache Software Foundation.
</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">
This software consists of voluntary contributions made by many individuals
on behalf of the Apache Software Foundation and was originally created by
James Tauber <jtauber@jtauber.com>. For more information on the Apache
Software Foundation, please see <fo:inline font-style="italic" font-family="serif">http://www.apache.org/</fo:inline>
<fo:inline font-family="serif">
(http://www.apache.org/)
</fo:inline>.
</fo:block>
<fo:block font-size="14pt" font-family="sans-serif" line-height="10pt" space-after.optimum="15pt" font-weight="bold" start-indent="15pt" break-before="page">
Content
</fo:block>
<fo:table>
<fo:table-column column-width="1cm"/>
<fo:table-column column-width="12cm"/>
<fo:table-column column-width="1cm"/>
<fo:table-body font-size="10pt" font-family="sans-serif">
<fo:table-row line-height="12pt">
<fo:table-cell>
<fo:block text-align="end">A)
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec1">What is FOP?</fo:basic-link></fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="end"><fo:page-number-citation ref-id="sec1"/></fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row line-height="12pt">
<fo:table-cell>
<fo:block text-align="end">B)
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec2">Downloading FOP</fo:basic-link></fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="end"><fo:page-number-citation ref-id="sec2"/></fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row line-height="12pt">
<fo:table-cell>
<fo:block text-align="end">C)
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec3">Running FOP</fo:basic-link></fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="end"><fo:page-number-citation ref-id="sec3"/></fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row line-height="12pt">
<fo:table-cell>
<fo:block text-align="end">D)
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec4">Embedding FOP</fo:basic-link> </fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="end"><fo:page-number-citation ref-id="sec4"/></fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row line-height="12pt">
<fo:table-cell>
<fo:block text-align="end">E)
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec5">What's Implemented?</fo:basic-link></fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="end"><fo:page-number-citation ref-id="sec5"/></fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row line-height="12pt">
<fo:table-cell>
<fo:block text-align="end">F)
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec6">Limitations</fo:basic-link></fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="end"><fo:page-number-citation ref-id="sec6"/></fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row line-height="12pt">
<fo:table-cell>
<fo:block text-align="end">G)
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec7">Bugs</fo:basic-link></fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="end"><fo:page-number-citation ref-id="sec7"/></fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row line-height="12pt">
<fo:table-cell>
<fo:block text-align="end">H)
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec8">Compiling FOP</fo:basic-link></fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="end"><fo:page-number-citation ref-id="sec8"/></fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row line-height="12pt">
<fo:table-cell>
<fo:block text-align="end">I)
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec9">Getting involved</fo:basic-link></fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="end"><fo:page-number-citation ref-id="sec9"/></fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row line-height="12pt">
<fo:table-cell>
<fo:block text-align="end">J)
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec10">FOP Relevant Specifications</fo:basic-link></fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="end"><fo:page-number-citation ref-id="sec10"/></fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row line-height="12pt">
<fo:table-cell>
<fo:block text-align="end">K)
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec11">Licence</fo:basic-link></fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="end"><fo:page-number-citation ref-id="sec11"/></fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:flow>
</fo:page-sequence>
</fo:root>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/forms/add-department.xsp
Index: add-department.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page
language="java"
xmlns:xsp="http://apache.org/xsp"
>
<page>
<title>Add a Department</title>
<content>
<form action="process-department" method="POST">
<input name="process" type="hidden" value="Add"/>
<para>Department Name: <input name="name" type="text"/></para>
<input type="submit" value="Add"/>
</form>
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/forms/add-employee.xsp
Index: add-employee.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page
language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:esql="http://apache.org/cocoon/SQL/v2"
>
<page>
<title>Add an Employee</title>
<content>
<form action="process-employee" method="POST">
<input name="process" type="hidden" value="Add"/>
<para>Employee Name: <input name="name" type="text"/></para>
<para>Department:
<select name="department">
<esql:connection>
<esql:pool>personnel</esql:pool>
<esql:execute-query>
<esql:query>select id, name from department order by name</esql:query>
<esql:results>
<esql:row-results>
<option>
<xsp:attribute name="value"><esql:get-int column="id"/></xsp:attribute>
<esql:get-string column="name"/>
</option>
</esql:row-results>
</esql:results>
</esql:execute-query>
</esql:connection>
</select>
</para>
<input type="submit" value="Add"/>
</form>
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/forms/employee.xml
Index: employee.xml
===================================================================
<?xml version="1.0"?>
<employee>
<connection>personnel</connection>
<table name="employee">
<keys>
<key param="employee" dbcol="id" type="int" mode="manual"/>
</keys>
<values>
<value param="name" dbcol="name" type="string"/>
<value param="department" dbcol="department_id" type="int"/>
</values>
</table>
</employee>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/forms/employee.xsp
Index: employee.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page
language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:esql="http://apache.org/cocoon/SQL/v2"
>
<page>
<xsp:logic>
String empID = request.getParameter("employee");
String depID = request.getParameter("department");
String name = request.getParameter("name");
String message = (String) request.getAttribute("message");
</xsp:logic>
<title>Manage Employees</title>
<para style="backgroud-color:#ff0000"><xsp:expr>(message == null?"":message)</xsp:expr></para>
<content>
<form name="EmployeeSelection">
<select size="1" name="employee"
onChange="top.location.href=window.location.pathname + '?employee=' + document.forms['EmployeeSelection'].employee.options[document.forms['EmployeeSelection'].employee.options.selectedIndex].value">
<option value="-1">-- New employee --</option>
<esql:connection>
<esql:pool>personnel</esql:pool>
<esql:execute-query>
<esql:query>select id, department_id, name from employee order by name</esql:query>
<esql:results>
<esql:row-results>
<xsp:logic>
if (<esql:get-string column="id"/>.equals(empID)) {
depID = <esql:get-string column="department_id"/>;
name = <esql:get-string column="name"/>;
xspAttr.addAttribute("", "selected", "selected", "CDATA", "");
}
</xsp:logic>
<option>
<xsp:attribute name="value"><esql:get-int column="id"/></xsp:attribute>
<esql:get-string column="name"/>
</option>
</esql:row-results>
</esql:results>
</esql:execute-query>
</esql:connection>
</select>
</form>
<form action="" method="POST" name="EmployeeEntry">
<script>document.forms["EmployeeEntry"].action = window.location.pathname</script>
<input type="hidden" name="employee">
<xsp:attribute name="value"><xsp:expr>((empID != null) ? empID : "")</xsp:expr></xsp:attribute>
</input>
<para>Employee Name:
<input name="name" type="text">
<xsp:attribute name="value"><xsp:expr>((name != null) ? name : "")</xsp:expr></xsp:attribute>
</input>
</para>
<para>Department:
<select name="department">
<option value="-1">-- Select department --</option>
<esql:connection>
<esql:pool>personnel</esql:pool>
<esql:execute-query>
<esql:query>select id, name from department order by name</esql:query>
<esql:results>
<esql:row-results>
<xsp:logic>
if (<esql:get-string column="id"/>.equals(depID)) {
xspAttr.addAttribute("", "selected", "selected", "CDATA", "");
}
</xsp:logic>
<option>
<xsp:attribute name="value"><esql:get-int column="id"/></xsp:attribute>
<esql:get-string column="name"/>
</option>
</esql:row-results>
</esql:results>
</esql:execute-query>
</esql:connection>
</select>
</para>
<xsp:logic>
<![CDATA[
if (empID != null && !empID.equals("-1")) {
]]>
<input type="submit" name="cocoon-action-Update" value="click here to update"/>
<input type="submit" name="cocoon-action-Delete" value="click here to delete"/>
} else {
<input type="submit" name="cocoon-action-Add" value="click here to add"/>
}
</xsp:logic>
</form>
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/forms/process-department.xsp
Index: process-department.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page
language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:esql="http://apache.org/cocoon/SQL/v2"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
>
<xsp:logic>
String process = null;
String name = null;
int currId = -1;
</xsp:logic>
<page>
<xsp:logic>
process = <xsp-request:get-parameter name="process"/>;
name = <xsp-request:get-parameter name="name"/>;
</xsp:logic>
<title><xsp:expr>process</xsp:expr> Department Processed</title>
<content>
<esql:connection>
<esql:pool>personnel</esql:pool>
<esql:execute-query>
<esql:query>
select max(id) as maxid from department
</esql:query>
<esql:results>
<esql:row-results>
<xsp:logic>
currId = <esql:get-int column="maxid"/>;
</xsp:logic>
<esql:execute-query>
<esql:query>
insert into department (id, name) values (
(<esql:parameter><xsp:expr>currId</xsp:expr></esql:parameter> + 1),
<esql:parameter><xsp:expr>name</xsp:expr></esql:parameter>
)
</esql:query>
</esql:execute-query>
</esql:row-results>
</esql:results>
</esql:execute-query>
</esql:connection>
<para><xsp:expr>name</xsp:expr> added</para>
<a href="../welcome">Back to the welcome page</a>
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/forms/process-employee.xsp
Index: process-employee.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page
language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:esql="http://apache.org/cocoon/SQL/v2"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
>
<xsp:logic>
String process = null;
String name = null;
String departmentId = null;
int currId = -1;
</xsp:logic>
<page>
<xsp:logic>
process = <xsp-request:get-parameter name="process"/>;
name = <xsp-request:get-parameter name="name"/>;
departmentId = <xsp-request:get-parameter name="department"/>;
</xsp:logic>
<title><xsp:expr>process</xsp:expr> Employee Processed</title>
<content>
<esql:connection>
<esql:pool>personnel</esql:pool>
<esql:autocommit>false</esql:autocommit>
<esql:execute-query>
<esql:query>select max(id) as maxid from employee</esql:query>
<esql:results>
<esql:row-results>
<xsp:logic>
currId = <esql:get-int column="maxid"/>;
</xsp:logic>
<esql:execute-query>
<esql:query>
insert into employee (id, name, department_id) values (
(<esql:parameter><xsp:expr>currId + 1</xsp:expr></esql:parameter>),
<esql:parameter><xsp:expr>name</xsp:expr></esql:parameter>,
<esql:parameter><xsp:expr>departmentId</xsp:expr></esql:parameter>
)
</esql:query>
</esql:execute-query>
</esql:row-results>
</esql:results>
</esql:execute-query>
</esql:connection>
<para><xsp:expr>name</xsp:expr> added</para>
<a href="../welcome">Back to the welcome page</a>
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/formvalidation/ERROR.xsp
Index: ERROR.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?><!-- -*- sgml -*- -->
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-formval="http://apache.org/xsp/form-validator/2.0"
xmlns:xsp-request="http://apache.org/xsp/request/2.0">
<page>
<title>Car Reservation</title>
<content>
<para>
Informal validation results <xsp:expr><xsp-formval:results/></xsp:expr>
</para>
<form action="test" method="POST">
<!-- use this to get a clue if the user had a chance to fill in
any date already -->
<input type="hidden" name="visited" value="true"/>
<xsp:logic>
boolean userHasSeenForm = (<xsp-request:get-parameter name="visited"/>!=null);
</xsp:logic>
<para>
How many persons should the car seat?
<input type="TEXT" name="persons" size="2">
<xsp:attribute name="value"><xsp-request:get-parameter name="persons" default=""/></xsp:attribute>
</input>
<xsp-formval:descriptor name="context://docs/samples/formvalidation/descriptor.xml" constraint-set="car-reservation">
<xsp:logic>
if (userHasSeenForm) {
if (<xsp-formval:is-toosmall name="persons"/> ) {
<b> The smallest available car seats <xsp-formval:get-attribute parameter="persons" name="min"/></b>
} else if ( <xsp-formval:is-toolarge name="persons"/> ) {
<b> The largest available car seats <xsp-formval:get-attribute parameter="persons" name="max"/></b>
} else if (<xsp-formval:is-error name="persons"/> ) {
<b> Some error occured. Your input is not correct. </b>
};
};
</xsp:logic>
</xsp-formval:descriptor>
</para>
<xsp-formval:descriptor name="context://docs/samples/formvalidation/descriptor.xml" constraint-set="car-reservation">
<para>
<xsp-formval:validate name="deposit">
Please enter your deposit EUR
<input type="TEXT" name="deposit" size="10">
<xsp:attribute
name="value"><xsp-request:get-parameter name="deposit" default=""/></xsp:attribute>
</input>
<xsp:logic>
if (userHasSeenForm) {
if ( <xsp-formval:is-null/>) {
<b> You need to specify a deposit </b>
} else if ( <xsp-formval:is-toosmall/> ) {
<b> The deposit has to be at least EUR <xsp-formval:get-attribute name="min"/></b>
} else if ( <xsp-formval:is-toolarge/> ) {
<b> The deposit has to be at most EUR <xsp-formval:get-attribute name="max"/></b>
} else if (<xsp-formval:is-notpresent/> ) {
<b></b>
} else if ( <xsp-formval:is-error/>) {
<b> Some error occured. Your input is not correct. </b>
};
};
</xsp:logic>
</xsp-formval:validate><br/>
</para>
<para>
<xsp-formval:validate name="email">
Please enter your email
<input type="TEXT" name="email" size="50">
<xsp:attribute
name="value"><xsp-request:get-parameter name="email" default=""/></xsp:attribute>
</input>
<xsp:logic>
if (userHasSeenForm) {
if ( <xsp-formval:is-null/>) {
<b> You need to specify an email </b>
} else if ( <xsp-formval:is-nomatch/> ) {
<b> This does not seem to be a valid email
address. Expected <pre><xsp-formval:get-attribute
parameter="email" name="matches-regex"/></pre></b>
} else if ( <xsp-formval:is-toolarge/> ) {
<b> Only addresses with up to <xsp-formval:get-attribute parameter="email" name="max-len"/> characters are accepted</b>
} else if (<xsp-formval:is-notpresent/> ) {
<b></b>
} else if ( <xsp-formval:is-error/>) {
<b> Some error occured. Your input is not correct. </b>
};
};
</xsp:logic>
</xsp-formval:validate><br/>
</para>
</xsp-formval:descriptor>
<input type="submit" name="submit" value="submit"/>
</form>
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/formvalidation/OK.xsp
Index: OK.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?><!-- -*- sgml -*- -->
<xsp:page
language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-formval="http://apache.org/xsp/form-validator/2.0"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
>
<page>
<title>Car Reservation</title>
<content>
<para>You've successfully reserved a car for
<b><xsp-request:get-parameter name="persons"/></b> with a deposit of
<b>EUR <xsp-request:get-parameter name="deposit"/></b>.</para>
<para> Details will be sent to your e-mail address
<tt><xsp-request:get-parameter name="email"/></tt></para>
<para>You can make a new reservation <a href="test">here</a></para>
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/formvalidation/descriptor.xml
Index: descriptor.xml
===================================================================
<?xml version="1.0"?>
<root>
<parameter name="persons" type="long" min="2" default="9" nullable="yes"/>
<parameter name="deposit" type="double" min="10.0" max="999.99"/>
<parameter name="email" type="string" max-len="50" matches-regex="^[\d\w][\d\w\-_\.]*@([\d\w\-_]+\.)\w\w\w?$"/>
<constraint-set name="car-reservation">
<validate name="persons"/>
<validate name="deposit" min="50.0"/>
<validate name="email"/>
</constraint-set>
</root>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/referer/a/a.xml
Index: a.xml
===================================================================
<?xml version="1.0"?>
<page>
<title>previous state <b>a</b> - current state <b>a</b></title>
<content>
<a href="a">a</a>
<a href="b">b</a>
</content>
</page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/referer/a/b.xml
Index: b.xml
===================================================================
<?xml version="1.0"?>
<page>
<title>previous state <b>a</b> - current state <b>b</b></title>
<content>
<a href="a">a</a>
<a href="b">b</a>
</content>
</page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/referer/b/a.xml
Index: a.xml
===================================================================
<?xml version="1.0"?>
<page>
<title>previous state <b>b</b> - current state <b>a</b></title>
<content>
<a href="a">a</a>
<a href="b">b</a>
</content>
</page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/referer/b/b.xml
Index: b.xml
===================================================================
<?xml version="1.0"?>
<page>
<title>previous state <b>b</b> - current state <b>b</b></title>
<content>
<a href="a">a</a>
<a href="b">b</a>
</content>
</page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/script-action/addknowncourse.js
Index: addknowncourse.js
===================================================================
// Step 1 -- Retrieve helper "beans" from the BSF framework
scriptaction = bsf.lookupBean( "scriptaction" )
manager = bsf.lookupBean( "manager" )
request = bsf.lookupBean( "request" )
logger = bsf.lookupBean( "logger" )
actionMap = bsf.lookupBean( "actionMap" )
// Step 2 -- Perform the action
logger.debug( "START addknowncourse.js" )
// Retrieve things from the session and request
// NOTE: they are all of type java.lang.String
session = request.getSession( false )
uwid = session.getAttribute( "uwid" )
term = request.getParameter( "term" )
course = request.getParameter( "course" )
distanceEd = request.getParameter( "distanceEd" )
extra = request.getParameter( "extra" )
logger.debug( "Raw" )
logger.debug( " uwid [" + uwid + "]" )
logger.debug( " term [" + term + "]" )
logger.debug( " course [" + course + "]" )
logger.debug( " distanceEd [" + distanceEd + "]" )
logger.debug( " extra [" + extra + "]" )
// Cook things a little to make them palatable to the database
if ( term == "0" ) { term = "" }
if ( course == "0" ) { course = "" }
if ( distanceEd == "on" ) { distanceEd = 2 } else { distanceEd = 1 }
if ( extra == "on" ) { extra = 2 } else { extra = 1 }
logger.debug( "Cooked" )
logger.debug( " uwid [" + uwid + "]" )
logger.debug( " term [" + term + "]" )
logger.debug( " course [" + course + "]" )
logger.debug( " distanceEd [" + distanceEd + "]" )
logger.debug( " extra [" + extra + "]" )
// Actually do the database work
// We have the choice of declaring things out here and making them explicitly
// null, or we have to use a different comparison in the "finally" block (defined?)
dbselector = null
datasource = null
conn = null
addStatement = null
try
{
dbselector = manager.lookup( scriptaction.DB_CONNECTION )
datasource = dbselector.select( "ceabplanner" )
conn = datasource.getConnection()
addStatement = conn.prepareStatement(
"INSERT INTO studentKnownCourseList ( STUDENT, KNOWN_COURSE, TERM_TAKEN, DISTANCE_ED, COURSE_EXTRA)" +
"VALUES ( ( SELECT id FROM students WHERE uw_userid = ? ), ?, ?, ?, ? )"
)
addStatement.setString( 1, uwid );
addStatement.setString( 2, course );
addStatement.setString( 3, term );
addStatement.setString( 4, distanceEd );
addStatement.setString( 5, extra );
result = addStatement.executeUpdate()
logger.debug( "Result #1 [" + result + "]" )
conn.commit()
actionMap.put( "scriptaction-continue", "" )
session.setAttribute( "results", "<SUCCESS>Course added at " + Date() + "</SUCCESS>" )
}
catch( ex )
{
logger.debug( "Caught Exception" )
logger.debug( " " + ex )
}
finally
{
if ( null != addStatement ) { addStatement.close() }
if ( null != conn ) { conn.close() }
if ( null != datasource ) { dbselector.release( datasource ) }
if ( null != dbselector ) { manager.release( dbselector ) }
}
logger.debug( "END addknown.js" )
1.1 xml-cocoon2/src/webapp/samples/docs/samples/script-action/addunknowncse.js
Index: addunknowncse.js
===================================================================
// Step 1 -- Retrieve helper "beans" from the BSF framework
scriptaction = bsf.lookupBean( "scriptaction" )
manager = bsf.lookupBean( "manager" )
request = bsf.lookupBean( "request" )
logger = bsf.lookupBean( "logger" )
actionMap = bsf.lookupBean( "actionMap" )
// Step 2 -- Perform the action
logger.debug( "START addunknown.js" )
lectureHrs = 3
labHrs = 0
tutorialHrs = 0
numWeeks = 12
courseWeight = 1
cseweight = 0
math = 0
sci = 0
engsci = 0
engdes = 0
// Retrieve things from the session and request
// NOTE: they are all of type java.lang.String
session = request.getSession( false )
uwid = session.getAttribute( "uwid" )
term = request.getParameter( "term" )
dept = request.getParameter( "dept" )
number = request.getParameter( "number" )
letter = request.getParameter( "letter" )
name = request.getParameter( "name" )
lectures = request.getParameter( "lectures" )
labs = request.getParameter( "labs" )
tutorials = request.getParameter( "tutorials" )
weeks = request.getParameter( "weeks" )
csetype = request.getParameter( "csetype" )
weight = request.getParameter( "weight" )
distanceEd = request.getParameter( "distanceEd" )
extra = request.getParameter( "extra" )
logger.debug( "Raw" )
logger.debug( " uwid [" + uwid + "]" )
logger.debug( " term [" + term + "]" )
logger.debug( " dept [" + dept + "]" )
logger.debug( " number [" + number + "]" )
logger.debug( " letter [" + letter + "]" )
logger.debug( " name [" + name + "]" )
logger.debug( " lectures [" + lectures + "]" )
logger.debug( " labs [" + labs + "]" )
logger.debug( " tutorials [" + tutorials + "]" )
logger.debug( " weeks [" + weeks + "]" )
logger.debug( " math [" + math + "]" )
logger.debug( " sci [" + sci + "]" )
logger.debug( " engsci [" + engsci + "]" )
logger.debug( " engdes [" + engdes + "]" )
logger.debug( " csetype [" + csetype + "]" )
logger.debug( " weight [" + weight + "]" )
logger.debug( " distanceEd [" + distanceEd + "]" )
logger.debug( " extra [" + extra + "]" )
logger.debug( " lectureHrs [" + lectureHrs + "]" )
logger.debug( " labHrs [" + labHrs + "]" )
logger.debug( " tutorialHrs [" + tutorialHrs + "]" )
logger.debug( " numWeeks [" + numWeeks + "]" )
logger.debug( " courseWeight [" + courseWeight + "]" )
logger.debug( " cseweight [" + cseweight + "]" )
// Cook things a little to make them palatable to the database
if (lectures != null) { lectureHrs = ( lectures + "" ) }
if (labs != null) { labHrs = ( labs + "" ) }
if (tutorials != null) { tutorialHrs = ( tutorials + "" ) }
if (weeks != null) { numWeeks = ( weeks + "" ) }
if (weight != null) { courseWeight = ( weight + "" ) }
// The "/1" is vital to ensure a numeric context
cseweight=(((lectureHrs/1)+(labHrs/2)+(tutorialHrs/2))*numWeeks*courseWeight)
if ( distanceEd == "on" ) { distanceEd = 2 } else { distanceEd = 1 }
if ( extra == "on" ) { extra = 2 } else { extra = 1 }
logger.debug( "Cooked" )
logger.debug( " uwid [" + uwid + "]" )
logger.debug( " term [" + term + "]" )
logger.debug( " dept [" + dept + "]" )
logger.debug( " number [" + number + "]" )
logger.debug( " letter [" + letter + "]" )
logger.debug( " name [" + name + "]" )
logger.debug( " lectures [" + lectures + "]" )
logger.debug( " labs [" + labs + "]" )
logger.debug( " tutorials [" + tutorials + "]" )
logger.debug( " weeks [" + weeks + "]" )
logger.debug( " math [" + math + "]" )
logger.debug( " sci [" + sci + "]" )
logger.debug( " engsci [" + engsci + "]" )
logger.debug( " engdes [" + engdes + "]" )
logger.debug( " csetype [" + csetype + "]" )
logger.debug( " weight [" + weight + "]" )
logger.debug( " distanceEd [" + distanceEd + "]" )
logger.debug( " extra [" + extra + "]" )
logger.debug( " lectureHrs [" + lectureHrs + "]" )
logger.debug( " labHrs [" + labHrs + "]" )
logger.debug( " tutorialHrs [" + tutorialHrs + "]" )
logger.debug( " numWeeks [" + numWeeks + "]" )
logger.debug( " courseWeight [" + courseWeight + "]" )
logger.debug( " cseweight [" + cseweight + "]" )
// Actually do the database work
// We have the choice of declaring things out here and making them explicitly
// null, or we have to use a different comparison in the "finally" block (defined?)
dbselector = null
datasource = null
conn = null
addStatement = null
try
{
dbselector = manager.lookup( scriptaction.DB_CONNECTION )
datasource = dbselector.select( "ceabplanner" )
conn = datasource.getConnection()
addStatement = conn.prepareStatement(
"INSERT INTO otherCourses( ID, STUDENT, DEPARTMENT, COURSENUMBER, COURSELETTER, COURSENAME, MATH, SCI, ENGSCI, ENGDES, CSETYPE, CSEWEIGHT, TERM_TAKEN, DISTANCE_ED, COURSE_EXTRA) VALUES ( otherCourses_seq.nextval, ( SELECT id FROM students WHERE uw_userid = ? ), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )"
)
addStatement.setString( 1, uwid );
addStatement.setString( 2, dept );
addStatement.setString( 3, number );
addStatement.setString( 4, letter );
addStatement.setString( 5, name );
addStatement.setString( 6, math );
addStatement.setString( 7, sci );
addStatement.setString( 8, engsci );
addStatement.setString( 9, engdes );
addStatement.setString( 10, csetype );
addStatement.setString( 11, cseweight );
addStatement.setString( 12, term );
addStatement.setString( 13, distanceEd );
addStatement.setString( 14, extra );
result = addStatement.executeUpdate()
logger.debug( "Result #1 [" + result + "]" )
conn.commit()
actionMap.put( "scriptaction-continue", "" )
session.setAttribute( "results", "<SUCCESS>Unknown Complementary Studies course added at " + Date() + "</SUCCESS>" )
}
catch( ex )
{
logger.debug( "Caught Exception" )
logger.debug( " " + ex )
}
finally
{
if ( null != addStatement ) { addStatement.close() }
if ( null != conn ) { conn.close() }
if ( null != datasource ) { dbselector.release( datasource ) }
if ( null != dbselector ) { manager.release( dbselector ) }
}
logger.debug( "END addunknown.js" )
1.1 xml-cocoon2/src/webapp/samples/docs/samples/script-action/addunknownte.js
Index: addunknownte.js
===================================================================
// Step 1 -- Retrieve helper "beans" from the BSF framework
scriptaction = bsf.lookupBean( "scriptaction" )
manager = bsf.lookupBean( "manager" )
request = bsf.lookupBean( "request" )
logger = bsf.lookupBean( "logger" )
actionMap = bsf.lookupBean( "actionMap" )
// Step 2 -- Perform the action
logger.debug( "START addunknownte.js" )
csetype = ""
weight = 0
lectureHrs = 3
labHrs = 0
tutorialHrs = 0
numWeeks = 12
courseWeight = 0
mathWeight = 0
sciWeight = 0
engsciWeight = 0
engdesWeight = 0
mathWt = 0
sciWt = 0
engsciWt = 0
engdesWt = 0
// Retrieve things from the session and request
// NOTE: they are all of type java.lang.String
session = request.getSession( false )
uwid = session.getAttribute( "uwid" )
term = request.getParameter( "term" )
dept = request.getParameter( "dept" )
number = request.getParameter( "number" )
letter = request.getParameter( "letter" )
name = request.getParameter( "name" )
lectures = request.getParameter( "lectures" )
labs = request.getParameter( "labs" )
tutorials = request.getParameter( "tutorials" )
weeks = request.getParameter( "weeks" )
math = request.getParameter( "math" )
sci = request.getParameter( "sci" )
engsci = request.getParameter( "engsci" )
engdes = request.getParameter( "engdes" )
distanceEd = request.getParameter( "distanceEd" )
extra = request.getParameter( "extra" )
logger.debug( "Raw" )
logger.debug( " uwid [" + uwid + "]" )
logger.debug( " term [" + term + "]" )
logger.debug( " dept [" + dept + "]" )
logger.debug( " number [" + number + "]" )
logger.debug( " letter [" + letter + "]" )
logger.debug( " name [" + name + "]" )
logger.debug( " lectures [" + lectures + "]" )
logger.debug( " labs [" + labs + "]" )
logger.debug( " tutorials [" + tutorials + "]" )
logger.debug( " weeks [" + weeks + "]" )
logger.debug( " math [" + math + "]" )
logger.debug( " sci [" + sci + "]" )
logger.debug( " engsci [" + engsci + "]" )
logger.debug( " engdes [" + engdes + "]" )
logger.debug( " distanceEd [" + distanceEd + "]" )
logger.debug( " extra [" + extra + "]" )
logger.debug( " courseWeight [" + courseWeight + "]" )
logger.debug( " mathWt [" + mathWt + "]" )
logger.debug( " sciWt [" + sciWt + "]" )
logger.debug( " engsciWt [" + engsciWt + "]" )
logger.debug( " engdesWt [" + engdesWt + "]" )
// Cook things a little to make them palatable to the database
if (lectures != null) { lectureHrs = ( lectures + "" ) }
if (labs != null) { labHrs = ( labs + "" ) }
if (tutorials != null) { tutorialHrs = ( tutorials + "" ) }
if (weeks != null) { numWeeks = ( weeks + "" ) }
if (math != null) { mathWeight = ( math + "" ) }
if (sci != null) { sciWeight = ( sci + "" ) }
if (engsci != null) { engsciWeight = ( engsci + "" ) }
if (engdes != null) { engdesWeight = ( engdes + "" ) }
// The "/1" is vital to ensure a numeric context
courseWeight=(((lectureHrs/1)+(labHrs/2)+(tutorialHrs/2))*numWeeks)
mathWt = courseWeight*mathWeight
sciWt = courseWeight*sciWeight
engsciWt = courseWeight*engsciWeight
engdesWt = courseWeight*engdesWeight
if ( distanceEd == "on" ) { distanceEd = 2 } else { distanceEd = 1 }
if ( extra == "on" ) { extra = 2 } else { extra = 1 }
logger.debug( "Cooked" )
logger.debug( " uwid [" + uwid + "]" )
logger.debug( " term [" + term + "]" )
logger.debug( " dept [" + dept + "]" )
logger.debug( " number [" + number + "]" )
logger.debug( " letter [" + letter + "]" )
logger.debug( " name [" + name + "]" )
logger.debug( " lectures [" + lectures + "]" )
logger.debug( " labs [" + labs + "]" )
logger.debug( " tutorials [" + tutorials + "]" )
logger.debug( " weeks [" + weeks + "]" )
logger.debug( " math [" + math + "]" )
logger.debug( " sci [" + sci + "]" )
logger.debug( " engsci [" + engsci + "]" )
logger.debug( " engdes [" + engdes + "]" )
logger.debug( " distanceEd [" + distanceEd + "]" )
logger.debug( " extra [" + extra + "]" )
logger.debug( " courseWeight [" + courseWeight + "]" )
logger.debug( " mathWt [" + mathWt + "]" )
logger.debug( " sciWt [" + sciWt + "]" )
logger.debug( " engsciWt [" + engsciWt + "]" )
logger.debug( " engdesWt [" + engdesWt + "]" )
// Actually do the database work
// We have the choice of declaring things out here and making them explicitly
// null, or we have to use a different comparison in the "finally" block (defined?)
dbselector = null
datasource = null
conn = null
addStatement = null
try
{
dbselector = manager.lookup( scriptaction.DB_CONNECTION )
datasource = dbselector.select( "ceabplanner" )
conn = datasource.getConnection()
addStatement = conn.prepareStatement(
"INSERT INTO otherCourses( " +
"ID, STUDENT, DEPARTMENT, COURSENUMBER, COURSELETTER, COURSENAME, MATH, SCI, ENGSCI, ENGDES, TERM_TAKEN, DISTANCE_ED, COURSE_EXTRA, CSEWEIGHT)" +
"VALUES ( " +
"otherCourses_seq.nextval, ( SELECT id FROM students WHERE uw_userid = ? ), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0)"
)
addStatement.setString( 1, uwid );
addStatement.setString( 2, dept );
addStatement.setString( 3, number );
addStatement.setString( 4, letter );
addStatement.setString( 5, name );
addStatement.setString( 6, mathWt );
addStatement.setString( 7, sciWt );
addStatement.setString( 8, engsciWt );
addStatement.setString( 9, engdesWt );
addStatement.setString( 10, term );
addStatement.setString( 11, distanceEd );
addStatement.setString( 12, extra );
result = addStatement.executeUpdate()
logger.debug( "Result #1 [" + result + "]" )
conn.commit()
actionMap.put( "scriptaction-continue", "" )
session.setAttribute( "results", "<SUCCESS>Unknown Technical Elective added at " + Date() + "</SUCCESS>" )
}
catch( ex )
{
logger.debug( "Caught Exception" )
logger.debug( " " + ex )
}
finally
{
if ( null != addStatement ) { addStatement.close() }
if ( null != conn ) { conn.close() }
if ( null != datasource ) { dbselector.release( datasource ) }
if ( null != dbselector ) { manager.release( dbselector ) }
}
logger.debug( "END addunknownte.js" )
1.1 xml-cocoon2/src/webapp/samples/docs/samples/script-action/createuser.js
Index: createuser.js
===================================================================
// Step 1 -- Retrieve helper "beans" from the BSF framework
scriptaction = bsf.lookupBean( "scriptaction" )
manager = bsf.lookupBean( "manager" )
request = bsf.lookupBean( "request" )
logger = bsf.lookupBean( "logger" )
actionMap = bsf.lookupBean( "actionMap" )
// Step 2 -- Perform the action
logger.debug( "START createuser.js" )
// Retrieve things from the session and request
// NOTE: they are all of type java.lang.String
session = request.getSession( false )
uwid = session.getAttribute( "uwid" )
logger.debug( "Raw" )
logger.debug( " uwid [" + uwid + "]" )
// We have the choice of declaring things out here and making them explicitly
// null, or we have to use a different comparison in the "finally" block (defined?)
dbselector = null
datasource = null
conn = null
queryStatement = null
insertStatement = null
try
{
dbselector = manager.lookup( scriptaction.DB_CONNECTION )
datasource = dbselector.select( "ceabplanner" )
conn = datasource.getConnection()
// Check that the student exists
queryStatement = conn.prepareStatement(
"select count(*) here from students where uw_userid=? "
)
queryStatement.setString( 1, uwid )
resultSet = queryStatement.executeQuery()
resultSet.next()
userExists = resultSet.getInt("here")
logger.debug( "Result #1 [" + userExists + "]" )
if (!userExists)
{
logger.debug( "User does not exist...creating and initializing" )
insertStatement = conn.prepareStatement(
"INSERT INTO students (id, uw_userid, name, uw_id, current_term) values (students_seq.nextval, ?, '','', (SELECT id FROM terms WHERE description = '1A'))"
)
insertStatement.setString( 1, uwid );
result = insertStatement.executeUpdate()
logger.debug( "Result #2 [" + result + "]" )
insertStatement = conn.prepareStatement(
"insert into studentNotes (student,note) values ( ( SELECT id FROM students WHERE uw_userid = ? ),'')"
)
insertStatement.setString( 1, uwid );
result = insertStatement.executeUpdate()
logger.debug( "Result #3 [" + result + "]" )
insertStatement = conn.prepareStatement(
"INSERT INTO studentKnownCourseList (student, known_course, term_taken, distance_ed, course_extra) ( SELECT ( SELECT id FROM students WHERE uw_userid = ? ), course, term, '1', '1' FROM corecourses )"
)
insertStatement.setString( 1, uwid );
result = insertStatement.executeUpdate()
logger.debug( "Result #4 [" + result + "]" )
conn.commit()
}
else
{
logger.debug( "User exists" )
}
actionMap.put( "scriptaction-continue", "" )
}
catch( ex )
{
logger.debug( "Caught Exception" )
logger.debug( " " + ex )
}
finally
{
if ( null != queryStatement ) { queryStatement.close() }
if ( null != insertStatement ) { insertStatement.close() }
if ( null != conn ) { conn.close() }
if ( null != datasource ) { dbselector.release( datasource ) }
if ( null != dbselector ) { manager.release( dbselector ) }
}
logger.debug( "END createuser.js" )
1.1 xml-cocoon2/src/webapp/samples/docs/samples/script-action/deleteknown.js
Index: deleteknown.js
===================================================================
// Step 1 -- Retrieve helper "beans" from the BSF framework
scriptaction = bsf.lookupBean( "scriptaction" )
manager = bsf.lookupBean( "manager" )
request = bsf.lookupBean( "request" )
logger = bsf.lookupBean( "logger" )
actionMap = bsf.lookupBean( "actionMap" )
// Step 2 -- Perform the action
logger.debug( "START deleteknown.js" )
// Retrieve things from the session and request
// NOTE: they are all of type java.lang.String
session = request.getSession( false )
uwid = session.getAttribute( "uwid" )
id = request.getParameter( "id" )
logger.debug( "Raw" )
logger.debug( " uwid [" + uwid + "]" )
logger.debug( " id [" + id + "]" )
// Actually do the database work
// We have the choice of declaring things out here and making them explicitly
// null, or we have to use a different comparison in the "finally" block (defined?)
dbselector = null
datasource = null
conn = null
addStatement = null
try
{
dbselector = manager.lookup( scriptaction.DB_CONNECTION )
datasource = dbselector.select( "ceabplanner" )
conn = datasource.getConnection()
deleteStatement = conn.prepareStatement(
"DELETE FROM studentknowncourselist WHERE student = ( SELECT id FROM students WHERE uw_userid = ? ) AND known_course = ?"
)
deleteStatement.setString( 1, uwid );
deleteStatement.setString( 2, id );
result = deleteStatement.executeUpdate()
logger.debug( "Result #1 [" + result + "]" )
conn.commit()
actionMap.put( "scriptaction-continue", "" )
session.setAttribute( "results", "<SUCCESS>Course deleted at " + Date() + "</SUCCESS>" )
}
catch( ex )
{
logger.debug( "Caught Exception" )
logger.debug( " " + ex )
}
finally
{
if ( null != addStatement ) { addStatement.close() }
if ( null != conn ) { conn.close() }
if ( null != datasource ) { dbselector.release( datasource ) }
if ( null != dbselector ) { manager.release( dbselector ) }
}
logger.debug( "END deleteknown.js" )
1.1 xml-cocoon2/src/webapp/samples/docs/samples/script-action/deleteunknown.js
Index: deleteunknown.js
===================================================================
// Step 1 -- Retrieve helper "beans" from the BSF framework
scriptaction = bsf.lookupBean( "scriptaction" )
manager = bsf.lookupBean( "manager" )
request = bsf.lookupBean( "request" )
logger = bsf.lookupBean( "logger" )
actionMap = bsf.lookupBean( "actionMap" )
// Step 2 -- Perform the action
logger.debug( "START deleteunknown.js" )
// Retrieve things from the session and request
// NOTE: they are all of type java.lang.String
id = request.getParameter( "id" )
logger.debug( "Raw" )
logger.debug( " id [" + id + "]" )
// Actually do the database work
// We have the choice of declaring things out here and making them explicitly
// null, or we have to use a different comparison in the "finally" block (defined?)
dbselector = null
datasource = null
conn = null
addStatement = null
try
{
dbselector = manager.lookup( scriptaction.DB_CONNECTION )
datasource = dbselector.select( "ceabplanner" )
conn = datasource.getConnection()
deleteStatement = conn.prepareStatement(
"DELETE FROM otherCourses WHERE id = ?"
)
deleteStatement.setString( 1, id );
result = deleteStatement.executeUpdate()
logger.debug( "Result #1 [" + result + "]" )
conn.commit()
actionMap.put( "scriptaction-continue", "" )
}
catch( ex )
{
logger.debug( "Caught Exception" )
logger.debug( " " + ex )
}
finally
{
if ( null != addStatement ) { addStatement.close() }
if ( null != conn ) { conn.close() }
if ( null != datasource ) { dbselector.release( datasource ) }
if ( null != dbselector ) { manager.release( dbselector ) }
}
logger.debug( "END deleteunknown.js" )
1.1 xml-cocoon2/src/webapp/samples/docs/samples/script-action/login.js
Index: login.js
===================================================================
// Step 1 -- Retrieve helper "beans" from the BSF framework
request = bsf.lookupBean( "request" )
logger = bsf.lookupBean( "logger" )
actionMap = bsf.lookupBean( "actionMap" )
// Step 2 -- Perform the action
logger.debug( "START login.js" )
// Retrieve things from the request
// NOTE: they are all of type java.lang.String
uwid = request.getParameter( "uwid" )
password = request.getParameter( "password" )
logger.debug( "Raw" )
logger.debug( " uwid [" + uwid + "]" )
//logger.debug( " password [" + password + "]" )
// Hack since either the guy we stole the code from or
// Bruce has made an implementation error
password = password + "\0\0\0\0\0\0\0\0\0"
//logger.debug( "Cooked" )
//logger.debug( " password [" + password + "]" )
try
{
session = request.getSession(true)
radius = new Packages.RadiusClient( "engine.uwaterloo.ca","1812","7sjU2xbHa31s2" )
result = radius.Authenticate( uwid, password )
if ( radius.ACCESS_ACCEPT == result )
{
logger.debug( "Authentication succeeded" )
// Get (and optionally create) and populate the session
session.setAttribute( "uwid", uwid )
actionMap.put( "scriptaction-continue", "" )
}
else
{
logger.debug( "Authentication failed" )
session.setAttribute( "results", "<FAILURE>Incorrect User ID or Password</FAILURE>" )
}
}
catch( ex )
{
logger.debug( "Caught Exception" )
logger.debug( " " + ex )
}
logger.debug( "END login.js" )
1.1 xml-cocoon2/src/webapp/samples/docs/samples/script-action/updateinfo.js
Index: updateinfo.js
===================================================================
// Step 1 -- Retrieve helper "beans" from the BSF framework
scriptaction = bsf.lookupBean( "scriptaction" )
manager = bsf.lookupBean( "manager" )
request = bsf.lookupBean( "request" )
logger = bsf.lookupBean( "logger" )
actionMap = bsf.lookupBean( "actionMap" )
// Step 2 -- Perform the action
logger.debug( "START updateinfo.js" )
// Retrieve things from the session and request
// NOTE: they are all of type java.lang.String
session = request.getSession( false )
uwid = session.getAttribute( "uwid" )
studentname = request.getParameter( "studentname" )
studentnumber = request.getParameter( "studentnumber" )
current_term = request.getParameter( "current_term" )
note = request.getParameter( "note" )
logger.debug( "Raw" )
logger.debug( " uwid [" + uwid + "]" )
logger.debug( " studentname [" + studentname + "]" )
logger.debug( " studentnumber [" + studentnumber + "]" )
logger.debug( " current_term [" + current_term + "]" )
logger.debug( " note [" + note + "]" )
// Cook things to make them more palatable to the database
note = ( note + "" ) // convert to a JS string
if (note == " ") { note="" }
if ( note.length > 255 )
{
note = note.substring( 0, 255 ); // take the leading 255 characters
}
logger.debug( "Cooked" )
logger.debug( " uwid [" + uwid + "]" )
logger.debug( " studentname [" + studentname + "]" )
logger.debug( " studentnumber [" + studentnumber + "]" )
logger.debug( " current_term [" + current_term + "]" )
logger.debug( " note [" + note + "]" )
// We have the choice of declaring things out here and making them explicitly
// null, or we have to use a different comparison in the "finally" block (defined?)
dbselector = null
datasource = null
conn = null
updateStatement = null
try
{
dbselector = manager.lookup( scriptaction.DB_CONNECTION )
datasource = dbselector.select( "ceabplanner" )
conn = datasource.getConnection()
updateStatement = conn.prepareStatement(
"UPDATE students SET name = ?, current_term = ?, uw_id = ? WHERE uw_userid = ? "
)
updateStatement.setString( 1, studentname );
updateStatement.setString( 2, current_term );
updateStatement.setString( 3, studentnumber );
updateStatement.setString( 4, uwid );
result = updateStatement.executeUpdate()
logger.debug( "Result #1 [" + result + "]" )
updateStatement = conn.prepareStatement(
"UPDATE studentnotes SET note = ? WHERE student = ( SELECT id FROM students WHERE uw_userid = ? )"
)
updateStatement.setString( 1, note );
updateStatement.setString( 2, uwid );
result = updateStatement.executeUpdate()
logger.debug( "Result #2 [" + result + "]" )
conn.commit()
actionMap.put( "scriptaction-continue", "" )
session.setAttribute( "results", "<SUCCESS>Information Saved at " + Date() + "</SUCCESS>" )
}
catch( ex )
{
logger.debug( "Caught Exception" )
logger.debug( " " + ex )
}
finally
{
if ( null != updateStatement ) { updateStatement.close() }
if ( null != conn ) { conn.close() }
if ( null != datasource ) { dbselector.release( datasource ) }
if ( null != dbselector ) { manager.release( dbselector ) }
}
logger.debug( "END updateinfo.js" )
1.1 xml-cocoon2/src/webapp/samples/docs/samples/scripts/hello.js
Index: hello.js
===================================================================
// Sample javascript script for use with ScriptGenerator
// Step 1 -- Retrieve helper "beans" from the BSF framework
out = bsf.lookupBean( "output" )
logger = bsf.lookupBean( "logger" )
resolver = bsf.lookupBean( "resolver" )
source = bsf.lookupBean( "source" )
objModel = bsf.lookupBean( "objectModel" )
params = bsf.lookupBean( "parameters" )
// Step 2 -- Generate xml using whatever means you desire
xml = " \
<page> \
<title>Hello</title> \
<content> \
<para>This is my first Cocoon2 page!</para> \
<para>With help from JavaScript!</para> \
</content> \
</page>"
// note that you have access to the Cocoon logger
logger.debug( "Debug message from JavaScript" )
// Step 3 -- Append the generated xml to the output StringBuffer
out.append( xml )
1.1 xml-cocoon2/src/webapp/samples/docs/samples/scripts/hello.py
Index: hello.py
===================================================================
# Sample python script for use with ScriptGenerator
# Step 1 -- Retrieve helper "beans" from the BSF framework
out = bsf.lookupBean( "output" )
logger = bsf.lookupBean( "logger" )
resolver = bsf.lookupBean( "resolver" )
source = bsf.lookupBean( "source" )
objModel = bsf.lookupBean( "objectModel" )
params = bsf.lookupBean( "parameters" )
# Step 2 -- Generate xml using whatever means you desire
xml="""
<page>
<title>Hello</title>
<content>
<para>This is my first Cocoon2 page!</para>
<para>With help from Python!</para>
</content>
</page>"""
# note that you have access to the Cocoon logger
logger.debug( "Debug message from Python" )
# Step 3 -- Append the generated xml to the output StringBuffer
out.append( xml )
1.1 xml-cocoon2/src/webapp/samples/docs/samples/session-state/start.xsp
Index: start.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?><!-- -*- sgml -*- -->
<xsp:page
language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
xmlns:session="http://apache.org/xsp/session/2.0"
>
<page>
<title>Start page.</title>
<content>
<para>
This could be a login page. <a href="example">continue</a>
</para>
<xsp:logic>
String sessionID = <session:get-id/>;
</xsp:logic>
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/session-state/state01.xsp
Index: state01.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?><!-- -*- sgml -*- -->
<xsp:page
language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
xmlns:session="http://apache.org/xsp/session/2.0"
>
<page>
<title>state 0-1</title>
<content>
<form action="example" method="get">
<select size="1" name="next-state">
<option value="1">1</option>
<option value="2">2</option>
</select>
<input type="submit" name="go" value="go"/>
</form>
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/session-state/state11.xsp
Index: state11.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?><!-- -*- sgml -*- -->
<xsp:page
language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
xmlns:session="http://apache.org/xsp/session/2.0"
>
<page>
<title>state 1-1</title>
<content>
<form action="example" method="get">
<select size="1" name="next-state">
<option value="1">1</option>
<option value="2">2</option>
</select>
<input type="submit" name="go" value="go"/>
</form>
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/session-state/state12.xsp
Index: state12.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?><!-- -*- sgml -*- -->
<xsp:page
language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
xmlns:session="http://apache.org/xsp/session/2.0"
>
<page>
<title>state 1-2</title>
<content>
<form action="example" method="get">
<select size="1" name="next-state">
<option value="1">1</option>
<option value="2">2</option>
</select>
<input type="submit" name="go" value="go"/>
</form>
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/session-state/state21.xsp
Index: state21.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?><!-- -*- sgml -*- -->
<xsp:page
language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
xmlns:session="http://apache.org/xsp/session/2.0"
>
<page>
<title>state 2-1</title>
<content>
<form action="example" method="get">
<select size="1" name="next-state">
<option value="1">1</option>
<option value="2">2</option>
</select>
<input type="submit" name="go" value="go"/>
</form>
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/session-state/state22.xsp
Index: state22.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?><!-- -*- sgml -*- -->
<xsp:page
language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
xmlns:session="http://apache.org/xsp/session/2.0"
>
<page>
<title>state 2-2</title>
<content>
<form action="example" method="get">
<select size="1" name="next-state">
<option value="1">1</option>
<option value="2">2</option>
</select>
<input type="submit" name="go" value="go"/>
</form>
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/sites/jakarta_apache_org.xml
Index: jakarta_apache_org.xml
===================================================================
<?xml version="1.0"?>
<page title="The Jakarta Project">
<logo href="images/banner.gif"/>
<sidebar>
<group name="Essentials">
<link href="index.html">Front Page</link>
<link href="news/news.html">News & Status</link>
<link href="mission/index.html">Mission</link>
<link href="guidelines/index.html">Guidelines</link>
<link href="faq/faqindex.html">FAQs</link>
</group>
<group name="Download">
<link href="downloads/binindex.html">Binaries</link>
<link href="downloads/sourceindex.html">Source Code</link>
</group>
<group name="Get Involved">
<link href="getinvolved/getinvolvedindex.html">Overview</link>
<link href="getinvolved/cvsindex.html">CVS Repositories</link>
<link href="getinvolved/mail.html">Mailing Lists</link>
<link href="getinvolved/library.html">Reference Library</link>
</group>
<group name="SubProjects">
<link href="tomcat/index.html">Tomcat</link>
<link href="check/index.html">Tomcat Check</link>
</group>
<group name="Credits">
<link href="credits/whoweare.html">Who We Are</link>
<link href="credits/acknowledgements.html">Acknowledgements</link>
</group>
</sidebar>
<body>
<p>
The goal of the Jakarta Project is to provide commercial-quality
server solutions based on the Java Platform that are developed in an
open and cooperative fashion.
</p>
<p>
The Jakarta Project has nothing to do, nor condones, the unfortunate
situtation in East Timor. For more information about why the project
is named "Jakarta" <a href="naming.html">click here</a>.
</p>
<section title="Tomcat: Java Servlets and JavaServer Pages Reference Implementation">
<p>
The flagship product, Tomcat, is a world-class implementation of the
Java Servlet 2.2 and JavaServer Pages 1.1 Specifications. This
implementation will be used in the Apache Web Server as well as in
other web servers and development tools.
</p>
<p>
The Tomcat Implementation is currently in beta form. We are working
diligently on merging the current Apache Jserv Project's source code
with the Sun code. We expect to have a final release of Tomcat by the
end of 1999. To learn more about the various Tomcat releases, <a
href="downloads/binindex.html">click here</a>.
</p>
</section>
<section title="Anyone Can Participate">
<p>
The Jakarta Project is composed of members of the current Apache Jserv
Project, engineers from major corporations such as Sun and IBM, and
serious, committed developers at large. All interested developers are
welcome to join and participate. To learn more about getting involved,
<a href="getinvolved/getinvolvedindex.html">click here</a>.
</p>
</section>
</body>
</page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/sites/java_apache_org.xml
Index: java_apache_org.xml
===================================================================
<?xml version="1.0"?>
<page>
<title>The Java Apache Project News</title>
<author>Stefano Mazzocchi</author>
<version>$Id: java_apache_org.xml,v 1.1 2002/07/02 13:06:38 cziegeler Exp $</version>
<newscolumn>
<news>
<title>Avalon 3.0 alpha released!</title>
<link>http://java.apache.org/framework</link>
<date>11 Oct 2000</date>
<content>
Avalon 3.0. This is the latest release of the Apache Server Framework. It includes
security pattern enforcement, and improved deployment and enhanced classloading.
Documentation has been completely renewed.
</content>
</news>
<news>
<title>Java Apache Mail Enterprise Server (JAMES) 1.1 Released!</title>
<link>http://java.apache.org/james</link>
<date>27 Jul 2000</date>
<content>
JAMES 1.1 is the second release of a 100% pure Java Mail Server which implements our
Mailet (similar to Servlet) technology to provide a powerful mail based application
server. It is based on the Avalon server framework.
</content>
</news>
<news>
<title>Apache JServ 1.1.2 Released!</title>
<link>http://java.apache.org/jserv</link>
<date>17 Jun 2000</date>
<content>
Apache JServ 1.1.2 has been released. This version fixes some minor bugs. Please see
the change log for details.
</content>
</news>
<news>
<title>Apache Jetspeed 1.2b1 Released!</title>
<link>http://java.apache.org/jetspeed</link>
<date>15 Jun 2000</date>
<content>
Apache Jetspeed 1.2b1 has been released. This version provides an implementation of
iCalendar (RFC 2445), Portal Structure Markup Language (PSML) and numerous
performance improvements.
</content>
</news>
</newscolumn>
<statuscolumn>
<project>
<title>Apache JServ</title>
<link>http://java.apache.org/jserv</link>
<release>
<version>1.1.2</version>
<status type="available">Released</status>
<comment>
This new generation comes with: major performance improvements, improved
installation and documentation, tons of bug fixes, and much more.
</comment>
</release>
</project>
<project>
<title>Apache Avalon Framework</title>
<link>http://java.apache.org/framework</link>
<release>
<version>3.0a3</version>
<status type="available">Released</status>
<comment>
The Avalon project is an effort to create, design, develop and maintain a
common framework for server applications written using the Java language. This
framework will not be a standalone product, but will allow existing and yet to
be created server applications to fit into a common platform and to share code,
design and human resources.
</comment>
</release>
</project>
<project>
<title>Apache JMeter</title>
<link>http://java.apache.org/jmeter</link>
<release>
<version>1.4</version>
<status type="available">Released</status>
<comment>
The 100% pure, swing enabled, Java URL profiler/analyzer to test your server
performance, your servlet performance, to stress your servlets with heavy
multi-threading concurrent requests and much more...
</comment>
</release>
</project>
</statuscolumn>
<legal>
Sun, Sun Microsystems, Solaris, Java, JavaSoft, are trademarks or registered
trademarks of Sun Microsystems, Inc. UNIX is a registered trademark in the
United States and other countries, exclusively licensed through X/Open Company,
Ltd. Windows, WinNT and Win32 are registered trademark of Microsoft Corp. All other
product names mentioned herein and throughout the entire web site are trademarks
of their respective owners.
</legal>
</page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/slides/clean-page.xml
Index: clean-page.xml
===================================================================
<?xml version="1.0"?>
<!-- Author: Stefano Mazzocchi "stefano@apache.org" -->
<!-- Version: $Id: clean-page.xml,v 1.1 2002/07/02 13:06:38 cziegeler Exp $ -->
<page>
<title>First XSP Page</title>
<author>
<name>Stefano Mazzocchi</name>
<address>stefano@apache.org</address>
</author>
<p>Hi, I'm your first XSP page ever.</p>
<p>I've been requested <count/> times.</p>
<p>The content you are seeing in this page is provided to you
by an XML content producer that was compiled into Java bytecode
and executed at request time. This allows greater flexibility and
ease of use for page programmers without any performance degradation
since all XML parsing and such is precompiled and it's avoided at
request time.</p>
<p>Let's show some useful information with expression evaluation...</p>
<request-data>
<string name="Request method" method="Method"/>
<string name="Request URI" method="RequestURI"/>
<string name="Request protocol" method="Protocol"/>
<string name="Servlet path" method="ServletPath"/>
<string name="Path info" method="PathInfo"/>
<string name="Path translated" method="PathTranslated"/>
<string name="Query string" method="QueryString"/>
<int name="Content length" method="ContentLength"/>
<string name="Content type" method="ContentType"/>
<string name="Server name" method="ServerName"/>
<int name="Server port" method="ServerPort"/>
<string name="Remote user" method="RemoteUser"/>
<string name="Remote address" method="RemoteAddr"/>
<string name="Remote host" method="RemoteHost"/>
<string name="Authorization scheme" method="AuthType"/>
</request-data>
<p>Ok. Now that you know how logic can be transformed into content, let's
add some juice and mix logic with content generation
in a way that allows you to forget about what method is used to generate and
handle the content as XML and concentrate on having your work done.
Note, how XSP don't allow you to explicitly write something on the response
from the logic realm: this is one of the major
differences between XSP and other server pages technologies and allows
further processing of the produced content, as required, for example, by
XSL-transformations.</p>
<request-headers/>
<servlet-parameters/>
<p>All right, the first XSP page is over, but you can see the
dynamically syntax highlighted
<link href="../view-source.xml?filename=clean-page.xml">source of this page</link>
and its <link href="../view-source.xml?filename=page-xsp.xsl">logicsheet</link>
provided to you by another XSP page.</p>
<p>Enjoy XSP!</p>
</page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/slides/database-page.xml
Index: database-page.xml
===================================================================
<?xml version="1.0"?>
<?cocoon-process type="sql"?>
<page>
<connectiondefs>
<connection name="foo_connection">
<driver>org.gjt.mm.mysql.Driver</driver>
<dburl>jdbc:mysql://localhost/test</dburl>
<!--<username>foo_user</username>
<password>foo_password</password>-->
</connection>
</connectiondefs>
<query connection="foo_connection">
select * from foo_table
</query>
</page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/slides/ldap.xml
Index: ldap.xml
===================================================================
<?xml version="1.0"?>
<page>
<ldap-defs>
<ldap-server name="searchlight">
<initializer>com.sun.jndi.ldap.LdapCtxFactory</initializer>
<ldap-serverurl>ldap://ldap.weber.edu</ldap-serverurl>
</ldap-server>
</ldap-defs>
<ldap-query server="searchlight" ldap-searchbase="">
sn=*Green*
</ldap-query>
</page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/slides/lib-page.xml
Index: lib-page.xml
===================================================================
<?xml version="1.0"?>
<!-- Author: Stefano Mazzocchi "stefano@apache.org" -->
<!-- Version: $Id: lib-page.xml,v 1.1 2002/07/02 13:06:38 cziegeler Exp $ -->
<xsp:page
language="java"
xmlns:xsp="http://www.apache.org/1999/XSP/Core"
xmlns:request="http://www.apache.org/1999/XSP/Request"
xmlns:util="http://www.apache.org/1999/XSP/Util"
>
<page>
<title>First XSP Page</title>
<author>
<name>Stefano Mazzocchi</name>
<address>stefano@apache.org</address>
</author>
<p>Hi, I'm your first XSP page ever.</p>
<p>I've been requested <util:counter/> times.</p>
<p>The content you are seeing in this page is provided to you
by an XML content producer that was compiled into Java bytecode
and executed at request time. This allows greater flexibility and
ease of use for page programmers without any performance degradation
since all XML parsing and such is precompiled and it's avoided at
request time.</p>
<p>Let's show some useful information with expression evaluation...</p>
<list title="Request Data">
<element name="Request method"><request:get-method/></element>
<element name="Request URI"><request:get-request-uri/></element>
<element name="Request protocol"><request:get-protocol/></element>
<element name="Servlet path"><request:get-servlet-path/></element>
<element name="Path info"><request:get-path-info/></element>
<element name="Path translated"><request:get-path-translated/></element>
<element name="Query string"><request:get-query-string/></element>
<element name="Content length"><request:get-content-length/></element>
<element name="Content type"><request:get-content-type/></element>
<element name="Server name"><request:get-server-name/></element>
<element name="Server port"><request:get-server-port/></element>
<element name="Remote user"><request:get-remote-user/></element>
<element name="Remote address"><request:get-remote-addr/></element>
<element name="Remote host"><request:get-remote-host/></element>
<element name="Authorization scheme"><request:get-auth-type/></element>
</list>
<p>Ok. Now that you know how logic can be transformed into content, let's
add some juice and mix logic with content generation
in a way that allows you to forget about what method is used to generate and
handle the content as XML and concentrate on having your work done.
Note, how XSP don't allow you to explicitly write something on the response
from the logic realm: this is one of the major
differences between XSP and other server pages technologies and allows
further processing of the produced content, as required, for example, by
XSL-transformations.</p>
<!-- FIXME (SM): here should go some taglib to emulate the other two
examples, but we don't have yet a good way to iterate over items
and so on without using logic directly... more feedback is needed on
the taglib issue. -->
<p>All right, the first XSP page is over, but you can see the dynamically syntax highlighted
<link href="../view-source.xml?filename=lib-page.xml">source of this page</link>,
all provided to you by another XSP page.</p>
<p>Enjoy XSP!</p>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/slides/page.xml
Index: page.xml
===================================================================
<?xml version="1.0"?>
<!-- Author: Stefano Mazzocchi "stefano@apache.org" -->
<!-- Version: $Id: page.xml,v 1.1 2002/07/02 13:06:38 cziegeler Exp $ -->
<xsp:page
language="java"
xmlns:xsp="http://www.apache.org/1999/XSP/Core"
>
<xsp:logic>
static private int counter = 0;
private synchronized int count() {
return counter++;
}
private String normalize(String string) {
if (string == null) return "";
else return string;
}
</xsp:logic>
<page>
<title>First XSP Page</title>
<author>
<name>Stefano Mazzocchi</name>
<address>stefano@apache.org</address>
</author>
<p>Hi, I'm your first XSP page ever.</p>
<p>I've been requested <xsp:expr>count()</xsp:expr> times.</p>
<p>The content you are seeing in this page is provided to you
by an XML content producer that was compiled into Java bytecode
and executed at request time. This allows greater flexibility and
ease of use for page programmers without any performance degradation
since all XML parsing and such is precompiled and it's avoided at
request time.</p>
<p>Let's show some useful information with expression evaluation...</p>
<list title="Request Data">
<element name="Request method"><xsp:expr>normalize(request.getMethod())</xsp:expr></element>
<element name="Request URI"><xsp:expr>normalize(request.getRequestURI())</xsp:expr></element>
<element name="Request protocol"><xsp:expr>normalize(request.getProtocol())</xsp:expr></element>
<element name="Servlet path"><xsp:expr>normalize(request.getServletPath())</xsp:expr></element>
<element name="Path info"><xsp:expr>normalize(request.getPathInfo())</xsp:expr></element>
<element name="Path translated"><xsp:expr>normalize(request.getPathTranslated())</xsp:expr></element>
<element name="Query string"><xsp:expr>normalize(request.getQueryString())</xsp:expr></element>
<element name="Content length"><xsp:expr>request.getContentLength()</xsp:expr></element>
<element name="Content type"><xsp:expr>normalize(request.getContentType())</xsp:expr></element>
<element name="Server name"><xsp:expr>normalize(request.getServerName())</xsp:expr></element>
<element name="Server port"><xsp:expr>request.getServerPort()</xsp:expr></element>
<element name="Remote user"><xsp:expr>normalize(request.getRemoteUser())</xsp:expr></element>
<element name="Remote address"><xsp:expr>normalize(request.getRemoteAddr())</xsp:expr></element>
<element name="Remote host"><xsp:expr>normalize(request.getRemoteHost())</xsp:expr></element>
<element name="Authorization scheme"><xsp:expr>normalize(request.getAuthType())</xsp:expr></element>
</list>
<p>Ok. Now that you know how logic can be transformed into content, let's
add some juice and mix logic with content generation
in a way that allows you to forget about what method is used to generate and
handle the content as XML and concentrate on having your work done.
Note, how XSP don't allow you to explicitly write something on the response
from the logic realm: this is one of the major
differences between XSP and other server pages technologies and allows
further processing of the produced content, as required, for example, by
XSL-transformations.</p>
<xsp:logic><![CDATA[
Enumeration e = request.getHeaderNames();
if ((e != null) && (e.hasMoreElements())) { ]]>
<p>Here are the request headers...</p>
<list title="Request Headers">
<xsp:logic><![CDATA[
while (e.hasMoreElements()) {
String k = (String) e.nextElement(); ]]>
<element>
<xsp:attribute name="name">
<xsp:expr>k</xsp:expr>
</xsp:attribute>
<xsp:expr>request.getHeader(k)</xsp:expr>
</element>
}
</xsp:logic>
</list>
}
</xsp:logic>
<xsp:logic><![CDATA[
e = request.getParameterNames();
if ((e != null) && (e.hasMoreElements())) { ]]>
<p>and here the servlet parameters that were passed along
with the request...</p>
<list title="Servlet Parameters">
<xsp:logic><![CDATA[
while (e.hasMoreElements()) {
String k = (String) e.nextElement();
String val = request.getParameter(k);
String vals[] = request.getParameterValues(k); ]]>
<element>
<xsp:attribute name="name">
<xsp:expr>k</xsp:expr>
</xsp:attribute>
<xsp:logic><![CDATA[
for(int i = 0; i < vals.length; i++) { ]]>
<item>
<xsp:expr>vals[i]</xsp:expr>
</item>
}
</xsp:logic>
</element>
}
</xsp:logic>
</list>
}
</xsp:logic>
<p>All right, the first XSP page is over, but you can see the
<link href="../view-source.xml?filename=page.xml">dynamically syntax highlighted</link>
source of this page provided to you by another XSP page.</p>
<p>Enjoy XSP!</p>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/slides/pyramid-model.gif
<<Binary file>>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/slides/schema.jpg
<<Binary file>>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/slides/slides.xml
Index: slides.xml
===================================================================
<?xml version="1.0"?>
<slides>
<title>Adding XML Capabilities with Cocoon</title>
<authors>
<person>
<name>Stefano Mazzocchi</name>
<email>stefano@apache.org</email>
</person>
</authors>
<event>
<name>ApacheCon 2000</name>
<date>March 9, 2000</date>
<time>7:30PM - 9:00PM</time>
<location>Caribe Royale Resort Suites & Villas. Orlando, Florida, U.S.A.</location>
</event>
<overview>
This session will show how to install, set up, and work with the Cocoon XML
publishing framework. The session will not cover XML technical details but
will show detailed examples on Cocoon power and details on future development.
</overview>
<section>
<title>Introduction</title>
<subtitle>let's see if this is any good for me</subtitle>
<slide>
<title>Who am I?</title>
<ul>
<li>My name is <strong>Stefano Mazzocchi</strong></li>
<li>Pronounced: <em>Stephan-O Madzock-key</em></li>
<li>I'm italian</li>
<li>I'm a student</li>
<li>I'm Cocoon's author and main architect</li>
</ul>
</slide>
<slide>
<title>Ok, but what is Cocoon?</title>
<ul>
<li>A publishing framework</li>
<li>A document generator</li>
<li>A small revolution</li>
</ul>
</slide>
<slide>
<title>Publishing framework?</title>
<ul>
<li>something that helps you publishing your stuff on the web</li>
<li>something that should impose strict yet flexible practices</li>
<li>something that should allow you to reduce your costs</li>
</ul>
</slide>
<slide>
<title>Costs? What costs?</title>
<ul>
<li>management costs</li>
<li>friction between human resources</li>
<li>costs of adapting to new needs</li>
<li>scalability costs</li>
</ul>
</slide>
<slide>
<title>The Cocoon Idea</title>
<quote>
The Cocoon project aims to change the way web information is created,
rendered and served.
</quote>
<quote>
This new paradigm is based on fact that document content, style and
logic are often created by different individuals or working groups.
</quote>
<quote>
Cocoon aims to a complete separation of the three layers, allowing the
three layers to be independently designed, created and managed, reducing
management overhead, increasing work reuse and reducing time to market.
</quote>
</slide>
<slide>
<title>The XML Model</title>
<p>Cocoon is an XML publishing framework.</p>
<p>Key technolgies are:</p>
<ul>
<li>XML</li>
<li>XML Namespaces</li>
<li>XSLT</li>
<li>XPath</li>
</ul>
</slide>
<slide>
<title>Supported Publishing Formats</title>
<ul>
<li>HTML+CSS</li>
<li>XSL(FO)</li>
<li>SVG</li>
<li>WML</li>
<li>VoxML</li>
<li>VRML</li>
<li>... you name it!</li>
</ul>
</slide>
<slide>
<title>What do you mean?</title>
<p>I mean that Cocoon is able to <em>publish</em> your data in any of
the above formats depending on user parameters or user devices.</p>
<p>All coming from a single file.</p>
<p>And easily extensible to any other format thru the use of a highly
modular architecture.</p>
</slide>
<slide>
<title>Hard to believe?</title>
<p><fork uri="../welcome">Let's take the tour.</fork></p>
</slide>
</section>
<section>
<title>Installation</title>
<subtitle>How to show your boss it was worth spending all that money for ApacheCon!</subtitle>
<slide>
<title>Cocoon Requirement</title>
<p>To install Cocoon you need:</p>
<ul>
<li>a Java 1.1 compatible virtual machine</li>
<li>a web server equipped with a Java Servlet API 2.x compliant servet engine</li>
</ul>
</slide>
<slide>
<title>Why Java?</title>
<ul>
<li>Portability</li>
<li>Strong OO features (interfaces)</li>
<li>Availability of XML components</li>
<li>Dynamic Linking capabilities</li>
</ul>
</slide>
<slide>
<title>Why a servlet?</title>
<ul>
<li>again, portability</li>
<li>ease of use</li>
<li>natural choice with Java for the web</li>
</ul>
</slide>
<slide>
<title>Why not Servlet 2.2 or Java 1.2?</title>
<p>guess what? portability!</p>
<ul>
<li>no 2.2 replacement for JServ available (yet! Tomcat is coming!)</li>
<li>no JDK 1.2 port on every platform (even if Linux support is finally out!)</li>
</ul>
</slide>
<slide>
<title>How do I install it on my servlet engine?</title>
<p>I probably don't know!</p>
<p>I develop on Apache stuff and know almost nothing about other servlet engines.</p>
<p>Even if Cocoon has been reported to work on all known ones, both commercial and free.</p>
<p>Anyway, you find detailed instructions for both <em>JServ</em> and <em>Tomcat</em> in
the handout and more up-to-date information on the web site.</p>
</slide>
</section>
<section>
<title>Cocoon Internals</title>
<subtitle>getting a better picture</subtitle>
<slide>
<title>Cocoon General Vision</title>
<figure src="slides/schema.jpg"/>
</slide>
<slide>
<title>The Content Generation Model</title>
<ul>
<li>producers: generate XML content</li>
<li>processors: process XML content</li>
<li>formatters: format XML into a stream representation</li>
</ul>
</slide>
<slide>
<title>Producer (generator)</title>
<ul>
<li>adapts the outside world to XML</li>
<li>produces <em>structured</em> information (now DOM, later SAX)</li>
<li>a parser is a producer</li>
<li>not all producers are parsers</li>
<li>producers are the XML equivalent of Servlets</li>
</ul>
</slide>
<slide>
<title>Processor (filter)</title>
<ul>
<li>process the structured content that comes in</li>
<li>creates structured content</li>
<li>examples: XSLT processor, SQL processor, LDAP processor</li>
<li>there is not such </li>
<li>Cocoon proocessors are the XML equivalent of Servlet Chaining</li>
</ul>
</slide>
<slide>
<title>Formatter (serializer)</title>
<ul>
<li>creates the final stream</li>
<li>examples: FOP (fo->PDF), SVG serializer</li>
</ul>
</slide>
</section>
<section>
<title>Dynamic Content</title>
<subtitle>let's do useful stuff</subtitle>
<slide>
<title>Logic-Content Integration</title>
<p>Possible alternatives are (for java):</p>
<ul>
<li>JSP</li>
<li>WebMacro</li>
<li>GSP</li>
</ul>
</slide>
<slide>
<title>Logic-Content Integration</title>
<p>Needs:</p>
<ul>
<li>logic and content reside on different files</li>
<li>reuse of logic on different documents</li>
<li>performance</li>
<li>programming language abstraction</li>
<li>output abstraction</li>
</ul>
</slide>
<slide>
<title>The problems of JSP</title>
<ul>
<li>logic has direct access to output</li>
<li>output is always streamed</li>
<li>not really designed for language abstraction</li>
</ul>
</slide>
<slide>
<title>Our solution: XSP</title>
<ul>
<li>logic has <strong>not</strong> direct access to output</li>
<li>output is <strong>never</strong> streamed</li>
<li>designed for language abstraction</li>
</ul>
</slide>
<slide>
<title>What does it look like?</title>
<source><![CDATA[
<xsp:page>
<page>
<p>Current time is <xsp:expr>new Date()</xsp:expr></p>
</page>
</xsp:page>
]]></source>
</slide>
<slide>
<title>How does it work?</title>
<ul>
<li>the XSP page is transformed into source code</li>
<li>the source code is compiled</li>
<li>the binary is executed at runtime</li>
<li>basically like any other server pages technology</li>
</ul>
</slide>
<slide>
<title>Ok, so what's the point?</title>
<ul>
<li>you don't have access to the output stream!</li>
</ul>
</slide>
<slide>
<title>But still, this is mixing content and logic!</title>
<p>Ok, look at this:</p>
<source><![CDATA[
<xsp:page>
<page>
<p>Current time is <util:date/></p>
</page>
</xsp:page>
]]></source>
<p>then you let Cocoon transform this with</p>
<source><![CDATA[
<xsl:template match="util:date">
<xsp:expr>new Data()</xsp:expr>
</xsl:template>
]]></source>
</slide>
<slide>
<title>Possible different scenarios</title>
<ul>
<li><link uri="../view-source?filename=/docs/samples/slides/page.xml">integrated xsp tags</link></li>
<li><link uri="../view-source?filename=/docs/samples/slides/clean-page.xml">custom tags transformed by your stylesheets</link></li>
<li><link uri="../view-source?filename=/docs/samples/slides/lib-page.xml">use of cocoon taglibs</link></li>
</ul>
</slide>
<slide>
<title>Other dynamic possibilities</title>
<ul>
<li><link uri="../view-source?filename=/docs/samples/slides/database-page.xml">SQLProcessor</link></li>
<li><link uri="../view-source?filename=/docs/samples/slides/ldap.xml">LDAPProcessor</link></li>
<li>... add yours</li>
</ul>
</slide>
<slide>
<title>Moving this into taglibs: why?</title>
<ul>
<li>performance</li>
<li>integration</li>
<li>portability</li>
<li>standardization</li>
</ul>
</slide>
<slide>
<title>Still not powerful enough?</title>
<p>Write your own:</p>
<ul>
<li>producer: to create from-java dynamic content</li>
<li>processor: to process some XML in some complex ways</li>
<li>formatter: to format an XML file to some binary formats</li>
</ul>
</slide>
</section>
<section>
<title>Future Development: Cocoon2</title>
<subtitle>improving the bleeding edge</subtitle>
<slide>
<title>Main Differences</title>
<ul>
<li>event driven architecture</li>
<li>improved overall structure</li>
<li>complete separation of contexts</li>
<li>better batch support</li>
</ul>
</slide>
<slide>
<title>Main Benefits</title>
<ul>
<li>lower per-request memory consumption</li>
<li>globally faster</li>
<li>increased perceived performance</li>
<li>enhanced modularity</li>
</ul>
</slide>
<slide>
<title>Main Drawbacks</title>
<ul>
<li>steeper learning curve (due to the sitemap)</li>
<li>module back incompatibility</li>
</ul>
</slide>
<slide>
<title>The Cocoon pyramid of contracts</title>
<figure src="slides/pyramid-model.gif"/>
</slide>
</section>
<section>
<title>Final Info</title>
<subtitle>where to find out more</subtitle>
<slide>
<title>Where do I get more info?</title>
<ul>
<li>Cocoon: <fork uri="http://xml.apache.org/cocoon"><strong>http://xml.apache.org/cocoon</strong></fork></li>
<li>XML and related info: <fork uri="http://www.xmlinfo.com"><strong>http://www.xmlinfo.com</strong></fork></li>
<li>XML and related specs: <fork uri="http://www.w3c.org"><strong>http://www.w3c.org</strong></fork></li>
</ul>
</slide>
<slide>
<title>The Cocoon Project</title>
<p>Active Developers (in alphabetical order):</p>
<ul>
<li>Donald Ball</li>
<li>Pierpaolo Fumagalli</li>
<li>Stefano Mazzocchi</li>
<li>Giacomo Pati</li>
<li>Ricardo Rocha</li>
</ul>
</slide>
<slide>
<title>Thank you!</title>
<p>Ok, I'm preparing the asbesto suite for the Q/A! :-)</p>
</slide>
</section>
<legal>
Copyright (c) 2000 Apache Software Foundation.
</legal>
</slides>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/slides/view-source.xsp
Index: view-source.xsp
===================================================================
<?xml version="1.0"?>
<!-- Written by Ricardo Rocha <rr...@plenix.org> -->
<!-- Fixed for version 2.0 by Davanum Srinivas <di...@yahoo.com> -->
<!-- A quick'n'dirty XML colorizer -->
<xsp:page
language="java"
xmlns:xsp="http://apache.org/xsp"
>
<xsp:structure>
<xsp:include>java.net.*</xsp:include>
<xsp:include>org.w3c.dom.*</xsp:include>
<xsp:include>org.apache.cocoon.xml.dom.DOMStreamer</xsp:include>
<xsp:include>org.apache.cocoon.xml.dom.DOMBuilder</xsp:include>
<xsp:include>org.apache.cocoon.components.parser.Parser</xsp:include>
<xsp:include>org.apache.cocoon.components.url.URLFactory</xsp:include>
</xsp:structure>
<xsp:logic><![CDATA[
private static final String ATTR_NAME_COLOR = "darkblue";
private static final String ATTR_VALUE_COLOR = "navy";
private static final String COMMENT_COLOR = "gray";
private static final String DELIMITER_COLOR = "blue";
private static final String ELEMENT_COLOR = "navy";
private static final String ENTITY_REF_COLOR = "navy";
private static final String PI_COLOR = "darkred";
private static final String TEXT_COLOR = "black";
private static final String CUSTOM_ELEMENT_COLOR = "green";
private static final String XSL_ELEMENT_COLOR = "purple";
private static final String XSP_ELEMENT_COLOR = "green";
private static final String XSP_TEXT_COLOR = "red";
protected void colorize(Node node, Document factory, org.xml.sax.ContentHandler contentHandler) throws SAXException {
Element element = factory.createElement("pre");
DocumentFragment fragment = factory.createDocumentFragment();
element.appendChild(doColorize(node, factory, 0, TEXT_COLOR));
DOMStreamer ds = new DOMStreamer (contentHandler);
ds.stream (element);
}
protected static DocumentFragment
doColorize(Node node, Document factory, int level, String textColor)
{
Element result = null;
DocumentFragment fragment = factory.createDocumentFragment();
switch (node.getNodeType()) {
case Node.CDATA_SECTION_NODE:
result = factory.createElement("font");
result.setAttribute("color", DELIMITER_COLOR);
result.appendChild(factory.createTextNode("<![CDATA["));
fragment.appendChild(result);
result = factory.createElement("font");
result.setAttribute("color", textColor);
result.appendChild(factory.createTextNode(node.getNodeValue()));
fragment.appendChild(result);
result = factory.createElement("font");
result.setAttribute("color", DELIMITER_COLOR);
// I know the thing below is ugly, but man, nexted CDATA are a pain in the ass!
result.appendChild(factory.createTextNode("]]]]>><![CDATA["));
fragment.appendChild(result);
break;
case Node.ELEMENT_NODE: {
Element element = (Element) node;
result = factory.createElement("font");
result.setAttribute("color", DELIMITER_COLOR);
result.appendChild(factory.createTextNode("<"));
fragment.appendChild(result);
String tagColor = ELEMENT_COLOR;
String tagName = element.getTagName();
if (tagName.startsWith("xsp:")) {
tagColor = XSP_ELEMENT_COLOR;
} else if (tagName.startsWith("xsl:")) {
tagColor = XSL_ELEMENT_COLOR;
} else if (tagName.indexOf(':') >= 0) {
tagColor = CUSTOM_ELEMENT_COLOR;
}
result = factory.createElement("font");
result.setAttribute("color", tagColor);
result.appendChild(factory.createTextNode(tagName));
fragment.appendChild(result);
NamedNodeMap attributes = element.getAttributes();
int attributeCount = attributes.getLength();
for (int i = 0; i < attributeCount; i++) {
Attr attribute = (Attr) attributes.item(i);
result = factory.createElement("font");
result.setAttribute("color", ATTR_NAME_COLOR);
result.appendChild(
factory.createTextNode(" " + attribute.getName() + "=")
);
fragment.appendChild(result);
result = factory.createElement("font");
result.setAttribute("color", ATTR_VALUE_COLOR);
result.appendChild(
factory.createTextNode("\"" + attribute.getValue() + "\"")
);
fragment.appendChild(result);
}
NodeList nodeList = element.getChildNodes();
int childCount = nodeList.getLength();
result = factory.createElement("font");
result.setAttribute("color", DELIMITER_COLOR);
result.appendChild(
factory.createTextNode((childCount == 0 ? "/" : "") + ">")
);
fragment.appendChild(result);
if (tagName.startsWith("xsp:")) {
textColor = XSP_TEXT_COLOR;
} else {
textColor = TEXT_COLOR;
}
result = factory.createElement("font");
result.setAttribute("color", textColor);
for (int i = 0; i < childCount; i++) {
result.appendChild(
doColorize(nodeList.item(i), factory, level + 1, textColor)
);
}
fragment.appendChild(result);
if (childCount > 0) {
result = factory.createElement("font");
result.setAttribute("color", DELIMITER_COLOR);
result.appendChild(factory.createTextNode("</"));
fragment.appendChild(result);
result = factory.createElement("font");
result.setAttribute("color", tagColor);
result.appendChild(factory.createTextNode(tagName));
fragment.appendChild(result);
result = factory.createElement("font");
result.setAttribute("color", DELIMITER_COLOR);
result.appendChild(factory.createTextNode(">"));
fragment.appendChild(result);
}
break;
}
case Node.DOCUMENT_NODE:
case Node.DOCUMENT_FRAGMENT_NODE: {
NodeList nodeList = node.getChildNodes();
int childCount = nodeList.getLength();
for (int i = 0; i < childCount; i++) {
fragment.appendChild(
doColorize(nodeList.item(i), factory, level + 1, textColor)
);
}
break;
}
case Node.COMMENT_NODE:
result = factory.createElement("font");
result.setAttribute("color", COMMENT_COLOR);
result.appendChild(
factory.createTextNode(
"<!-- " + node.getNodeValue() + " -->\n"
)
);
fragment.appendChild(result);
break;
case Node.PROCESSING_INSTRUCTION_NODE:
ProcessingInstruction pi = (ProcessingInstruction) node;
result = factory.createElement("font");
result.setAttribute("color", DELIMITER_COLOR);
result.appendChild(factory.createTextNode("<?"));
fragment.appendChild(result);
result = factory.createElement("font");
result.setAttribute("color", PI_COLOR);
result.appendChild(factory.createTextNode(pi.getTarget() + " " + pi.getData()));
fragment.appendChild(result);
result = factory.createElement("font");
result.setAttribute("color", DELIMITER_COLOR);
result.appendChild(factory.createTextNode("?>\n"));
fragment.appendChild(result);
break;
case Node.ENTITY_REFERENCE_NODE:
result = factory.createElement("font");
result.setAttribute("color", ENTITY_REF_COLOR);
result.appendChild(
factory.createTextNode("<" + node.getNodeValue() + ";")
);
fragment.appendChild(result);
break;
case Node.TEXT_NODE:
fragment.appendChild(factory.createTextNode(node.getNodeValue()));
break;
default:
break;
}
return fragment;
}
]]></xsp:logic>
<html>
<xsp:logic>
</xsp:logic>
<head>
<title>Source Code</title>
<link rel="stylesheet" type="text/css" href="style" title="Style"/>
</head>
<body>
<xsp:logic>
String filename = request.getParameter("filename");
if (filename != null) {
<h3 style="color:navy; text-align: center">
<xsp:expr>filename</xsp:expr>
</h3>
Parser newParser = null;
URLFactory factory = null;
try {
newParser = (Parser) this.manager.lookup(Parser.ROLE);
factory = (URLFactory) this.manager.lookup(URLFactory.ROLE);
Document document = newParser.newDocument();
DOMBuilder builder = new DOMBuilder(newParser);
newParser.setContentHandler(builder);
newParser.setLexicalHandler(builder);
URL url = factory.getURL(filename);
InputSource is = new InputSource(url.openStream());
newParser.parse(is);
this.colorize(builder.getDocument(), document, this.contentHandler);
} catch (SAXException e){
getLogger().debug("SAXException in colorize", e);
throw e;
} catch (org.w3c.dom.DOMException e){
getLogger().debug("DOMException in colorize", e);
throw e;
} catch (Exception e) {
getLogger().error("Could not include page", e);
} finally {
this.manager.release((Component) factory);
this.manager.release((Component) newParser);
}
} else {
<h3 style="color:navy; text-align: center">
Need <em>filename</em> or <em>url</em> parameters to work
</h3>
}
</xsp:logic>
</body>
</html>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/soap/fortune.xml
Index: fortune.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page
language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
xmlns:xscript="http://apache.org/xsp/xscript/1.0"
xmlns:soap="http://apache.org/xsp/soap/3.0"
>
<page>
<soap:call url="http://www.lemurlabs.com:80/rpcrouter">
<m:getAnyFortune xmlns:m="urn:lemurlabs-Fortune">
</m:getAnyFortune>
</soap:call>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/soap/getquote.xml
Index: getquote.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page
language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
xmlns:xscript="http://apache.org/xsp/xscript/1.0"
xmlns:soap="http://apache.org/xsp/soap/3.0"
>
<page>
<soap:call url="http://services.xmethods.net:80/soap">
<ns1:getQuote xmlns:ns1="urn:xmethods-delayed-quotes">
<soap:enc/>
<symbol xsi:type="xsd:string"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">SUNW</symbol>
</ns1:getQuote>
</soap:call>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/soap/joke.xml
Index: joke.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page
language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xscript="http://apache.org/xsp/xscript/1.0"
xmlns:soap="http://apache.org/xsp/soap/3.0"
>
<page>
<soap:call
url="http://thor.velocigen.com:80/vx_engine/soap-trigger.pperl"
method="urn:vgx-joke">
<ns1:JokeOfTheDay xmlns:ns1="urn:vgx-joke">
<soap:enc/>
</ns1:JokeOfTheDay>
</soap:call>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/soap/temperature.xml
Index: temperature.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page
language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
xmlns:xscript="http://apache.org/xsp/xscript/1.0"
xmlns:soap="http://apache.org/xsp/soap/3.0"
>
<page>
<soap:call url="http://services.xmethods.net:80/soap/servlet/rpcrouter">
<ns1:getTemp xmlns:ns1="urn:xmethods-Temperature">
<soap:enc/>
<zipcode xsi_type="xsd:string">90210</zipcode>
</ns1:getTemp>
</soap:call>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/sql/sql-page.xml
Index: sql-page.xml
===================================================================
<?xml version="1.0"?>
<page xmlns:sql="http://apache.org/cocoon/SQL/2.0">
<title>Hello</title>
<content>
<para>This is my first Cocoon2 page filled with sql data!</para>
<execute-query xmlns="http://apache.org/cocoon/SQL/2.0">
<query>
select id,name from department
</query>
<execute-query>
<query>
select id,name from employee where department_id = <ancestor-value sql:name="id" sql:level="1"/>
</query>
</execute-query>
</execute-query>
</content>
</page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/sql/sql-page.xml.sql
Index: sql-page.xml.sql
===================================================================
# MySQL dump 6.4
#
# Host: localhost Database: test
#--------------------------------------------------------
# Server version 3.22.27
#
# Table structure for table 'department'
#
CREATE TABLE department (
id int(11) DEFAULT '0' NOT NULL,
name varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (id)
);
#
# Dumping data for table 'department'
#
INSERT INTO department VALUES (1,'Programmers');
INSERT INTO department VALUES (2,'Loungers');
#
# Table structure for table 'employee'
#
CREATE TABLE employee (
id int(11) DEFAULT '0' NOT NULL,
department_id int(11) DEFAULT '0' NOT NULL,
name varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (id)
);
#
# Dumping data for table 'employee'
#
INSERT INTO employee VALUES (1,1,'Donald Ball');
INSERT INTO employee VALUES (2,1,'Stefano Mazzocchi');
INSERT INTO employee VALUES (3,2,'Pierpaolo Fumagalli');
1.1 xml-cocoon2/src/webapp/samples/docs/samples/stream/OrderPage.xml
Index: OrderPage.xml
===================================================================
<page>
<title>B2B processing</title>
<content>
<FORM action="request1" id="FORM1" method="post" name="FORM1">
<para>Input your XML documet here:</para>
<TEXTAREA cols="80" id="TEXTAREA1" name="Foo" rows="60"><?xml version="1.0"?>
<Orders>
<OrderID>20259</OrderID>
<CustomerID>WWWWWWW</CustomerID>
<EmployeeID>6</EmployeeID>
<OrderDate>2001-05-05 00:00:00</OrderDate>
<RequiredDate>2001-06-05 00:00:00</RequiredDate>
<ShippedDate>2001-06-01 00:00:00</ShippedDate>
<ShipVia>1</ShipVia>
<Freight>11.6100</Freight>
<ShipName>Thoms White</ShipName>
<ShipAddress>Somestr. 48</ShipAddress>
<ShipCity>Munster</ShipCity>
<ShipRegion>West</ShipRegion>
<ShipPostalCode>00000</ShipPostalCode>
<ShipCountry>Germany</ShipCountry>
<OrderDetails>
<OrderID>20259</OrderID>
<ProductID>51</ProductID>
<UnitPrice>42.4000</UnitPrice>
<Quantity>40</Quantity>
<Discount>0.0</Discount>
</OrderDetails>
<OrderDetails>
<OrderID>20259</OrderID>
<ProductID>14</ProductID>
<UnitPrice>18.6000</UnitPrice>
<Quantity>9</Quantity>
<Discount>0.0</Discount>
</OrderDetails>
<OrderDetails>
<OrderID>20259</OrderID>
<ProductID>7</ProductID>
<UnitPrice>12.4000</UnitPrice>
<Quantity>30</Quantity>
<Discount>0.0</Discount>
</OrderDetails>
<Customers>
<CustomerID>WWWWWWW</CustomerID>
<CompanyName>Thomas White</CompanyName>
<ContactName>Karin Black</ContactName>
<ContactTitle>Marketing Manager</ContactTitle>
<Address>Somestr. 48</Address>
<City>Munster</City>
<Region>West</Region>
<PostalCode>00000</PostalCode>
<Country>Germany</Country>
<Phone>xxxx-yyyyyy</Phone>
<Fax>xxxx-yyyyyy</Fax>
</Customers>
</Orders>
</TEXTAREA>
<INPUT id="submit1" name="submit1" type="submit" value="Submit"/>
</FORM>
</content>
</page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/svg/henryV.svg
Index: henryV.svg
===================================================================
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<!-- ========================================================================= -->
<!-- Copyright (C) The Apache Software Foundation. All rights reserved. -->
<!-- -->
<!-- This software is published under the terms of the Apache Software License -->
<!-- version 1.1, a copy of which has been included with this distribution in -->
<!-- the LICENSE file. -->
<!-- ========================================================================= -->
<!-- ========================================================================= -->
<!-- Test description here -->
<!-- -->
<!-- @author bill.haneman@ireland.sun.com -->
<!-- @version $Id: henryV.svg,v 1.1 2002/07/02 13:06:38 cziegeler Exp $ -->
<!-- ========================================================================= -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="450" height="500" viewBox="0 0 450 500">
<title>Henry V</title>
<!-- ============================================================= -->
<!-- Test content -->
<!-- ============================================================= -->
<defs>
<filter id="blur" filterUnits="objectBoundingBox" primitiveUnits="objectBoundingBox" x="-20%" y="-20%" width="120%" height="120%" >
<feGaussianBlur stdDeviation="2 2" x="-10%" y="-10%" width="120%" height="120%" />
</filter>
<filter id="wideBlur" filterUnits="objectBoundingBox" primitiveUnits="objectBoundingBox" x="-20%" y="-20%" width="120%" height="120%" >
<feGaussianBlur stdDeviation="8 8" x="-10%" y="-10%" width="120%" height="120%" />
</filter>
<clipPath id="shakeSpeare" font-family="Serif" font-weight="bold" font-size="125" text-anchor="middle" transform="scale(0.8, 1.5)">
<text x="50%" y="28%">Henry</text>
<text font-size="200" x="50%" y="60%">V</text>
</clipPath>
<g font-family="Serif" font-weight="bold" font-size="125" text-anchor="middle" id="henryV" transform="scale(0.8, 1.5)">
<text x="50%" y="28%">Henry</text>
<text font-size="200" x="50%" y="60%">V</text>
</g>
<g font-family="Serif" id="text" font-style="oblique" font-size="15" fill="DarkRed" transform="scale(1.10, 0.92)">
<text x="3%" y="6%">O for a Muse of fire, that would ascend</text>
<text x="3%" y="9%">The brightest heaven of invention,</text>
<text x="3%" y="12%">A kingdom for a stage, princes to act</text>
<text x="3%" y="15%">And monarchs to behold the swelling scene!</text>
<text x="3%" y="18%">Then should the warlike Harry, like himself,</text>
<text x="3%" y="21%">Assume the port of Mars; and at his heels,</text>
<text x="3%" y="24%">Leash'd in like hounds, should famine, sword and fire</text>
<text x="3%" y="27%">Crouch for employment. But pardon, and gentles all,</text>
<text x="3%" y="30%">The flat unraised spirits that have dared</text>
<text x="3%" y="33%">On this unworthy scaffold to bring forth</text>
<text x="3%" y="36%">So great an object: can this cockpit hold</text>
<text x="3%" y="39%">The vasty fields of France? or may we cram</text>
<text x="3%" y="42%">Within this wooden O the very casques</text>
<text x="3%" y="45%">That did affright the air at Agincourt?</text>
<text x="3%" y="48%">O, pardon! since a crooked figure may</text>
<text x="3%" y="51%">Attest in little place a million;</text>
<text x="3%" y="54%">And let us, ciphers to this great accompt,</text>
<text x="3%" y="57%">On your imaginary forces work.</text>
<text x="3%" y="60%">Suppose within the girdle of these walls</text>
<text x="3%" y="63%">Are now confined two mighty monarchies,</text>
<text x="3%" y="66%">Whose high upreared and abutting fronts</text>
<text x="3%" y="69%">The perilous narrow ocean parts asunder:</text>
<text x="3%" y="72%">Piece out our imperfections with your thoughts;</text>
<text x="3%" y="75%">Into a thousand parts divide on man,</text>
<text x="3%" y="78%">And make imaginary puissance;</text>
<text x="3%" y="81%">Think when we talk of horses, that you see them</text>
<text x="3%" y="84%">Printing their proud hoofs i' the receiving earth;</text>
<text x="3%" y="87%">For 'tis your thoughts that now must deck our kings,</text>
<text x="3%" y="90%">Carry them here and there; jumping o'er times,</text>
<text x="3%" y="93%">Turning the accomplishment of many years</text>
<text x="3%" y="96%">Into an hour-glass: for the which supply,</text>
<text x="3%" y="99%">Admit me Chorus to this history;</text>
<text x="3%" y="102%">Who prologue-like your humble patience pray,</text>
<text x="3%" y="105%">Gently to hear, kindly to judge, our play.</text>
</g>
</defs>
<rect width="100%" height="100%" fill="GoldenRod"/>
<g id="testContent" transform="scale(1.2,1.0)">
<g opacity="0.8" fill="Maroon">
<use xlink:href="#text"/>
</g>
<g transform="translate(-1, -1)">
<use xlink:href="#henryV" fill="DarkGoldenRod" stroke-width="0.1" stroke="black"/>
</g>
<g clip-path="url(#shakeSpeare)" transform="translate(-1, -1)">
<use xlink:href="#text"/>
<g font-style="normal">
<use xlink:href="#henryV" fill="none" stroke-width="4" stroke="black" filter="url(#blur)" opacity="0.35" transform="translate(-2, 2)"/>
</g>
</g>
</g>
<rect x="0%" y="0%" width="100%" height="100%" stroke="SaddleBrown" stroke-width="12" fill="none" filter="url(#wideBlur)"/>
</svg>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/svg/opac.svg
Index: opac.svg
===================================================================
<?xml version="1.0" standalone="yes"?>
<svg width="300px" height="300px">
<g style="fill:#444">
<path d="M0,0v250h300v-250z"/>
</g>
<g style="stroke:#000; stroke-width:2; fill:#f00; fill-opacity:0.5">
<circle cx="100" cy="100" r="80"/>
</g>
<g style="stroke:#000; stroke-width:2; fill:#00f; fill-opacity:0.5">
<circle cx="200" cy="100" r="80"/>
</g>
<g style="stroke:#000; stroke-width:2; fill:#0f0; fill-opacity:0.5">
<circle cx="150" cy="150" r="80"/>
</g>
</svg>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/xscript/simple.xsp
Index: simple.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- CVS: $Id: simple.xsp,v 1.1 2002/07/02 13:06:39 cziegeler Exp $ -->
<!--
Author: Ovidiu Predescu "ovidiu@cup.hp.com"
Date: September 18, 2001
-->
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
xmlns:xscript="http://apache.org/xsp/xscript/1.0">
<page>
<title>Inline XScript variable</title>
<content>
<para>
This is a simple XSP page demonstrating how to work with
inline XScript variables. This example show how one can create
and later refer to an XScript variable.
</para>
<xscript:variable name="my-var">
<b>123</b>
</xscript:variable>
<para>
The content of the XScript variable is: <xscript:get name="my-var"/>.
</para>
<para>
We now remove the Xscript variable "my-var", and try to access
it again. You should see an error message indicating it's no
longer available.
</para>
<para>
<xscript:remove name="my-var"/>
<xscript:get name="my-var"/>
</para>
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/xscript/soap-getquote1.xsl
Index: soap-getquote1.xsl
===================================================================
<?xml version="1.0" encoding="utf-8"?>
<!--
Author: Ovidiu Predescu "ovidiu@cup.hp.com"
Date: October 9, 2001
-->
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:n="urn:xmethods-delayed-quotes"
exclude-result-prefixes="soap n"
>
<xsl:template match="soap:Envelope">
<b><xsl:value-of select="soap:Body/n:getQuoteResponse/Result"/></b>
</xsl:template>
<xsl:template match="@*|*|text()|processing-instruction()">
<!-- Catch all template. Just pass along unmodified everything we
don't handle. -->
<xsl:copy>
<xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/xscript/soap-getquote1.xsp
Index: soap-getquote1.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- CVS: $Id: soap-getquote1.xsp,v 1.1 2002/07/02 13:06:39 cziegeler Exp $ -->
<!--
Author: Ovidiu Predescu "ovidiu@cup.hp.com"
Date: October 9, 2001
-->
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
xmlns:xscript="http://apache.org/xsp/xscript/1.0"
xmlns:soap="http://apache.org/xsp/soap/3.0">
<page>
<title>SOAP Stock Quote Example 1</title>
<content>
<xsp:logic>
String symbol = request.getParameter("symbol");
if (symbol == null || symbol.equals("")) {
<para>This page demonstrates the SOAP logicsheet for
Cocoon2. It accesses a SOAP service that provides stock quotes
and displays the result.</para>
<para>The SOAP result is placed in the generated page, and the
stock price is extracted from it using an external XSLT
stylesheet. Compare this approach with the one used in
<code>soap-getquote2.xsp</code>, which uses an internal XScript
stylesheet to extract the stock price.</para>
<para>Please enter the stock ticker: </para>
<form href="soap-getquote">
<input name="symbol" type="text" value="HPQ"/>
<input value="Do it!" type="submit"/>
</form>
} else {
<para>The stock price for <xsp:expr>symbol</xsp:expr> is
<soap:call url="http://services.xmethods.net:80/soap">
<ns1:getQuote xmlns:ns1="urn:xmethods-delayed-quotes">
<soap:enc/>
<symbol xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema"><xsp-request:get-parameter name="symbol"/></symbol>
</ns1:getQuote>
</soap:call>
</para>
<form href="soap-getquote">
<input value="Back" type="submit"/>
</form>
}
</xsp:logic>
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/xscript/soap-getquote2.xsp
Index: soap-getquote2.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- CVS: $Id: soap-getquote2.xsp,v 1.1 2002/07/02 13:06:39 cziegeler Exp $ -->
<!--
Author: Ovidiu Predescu "ovidiu@cup.hp.com"
Date: October 9, 2001
-->
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
xmlns:xscript="http://apache.org/xsp/xscript/1.0"
xmlns:soap="http://apache.org/xsp/soap/3.0">
<page>
<title>SOAP Stock Quote Example 2</title>
<content>
<xsp:logic>
String symbol = request.getParameter("symbol");
if (symbol == null || symbol.equals("")) {
<para>This page demonstrates the SOAP logicsheet for
Cocoon2. It accesses a SOAP service that provides stock quotes
and displays the result.</para>
<para>This example uses an inline XSLT stylesheet and an
XScript <code>transform</code> instruction to extract the stock
price. Compare this with the approach used in
<code>soap-getquote1.xsp</code>, which uses a sitemap XSLT
transformer to achieve the same thing.</para>
<para>Please enter the stock ticker: </para>
<form href="soap-getquote">
<input name="symbol" type="text" value="HPQ"/>
<input value="Do it!" type="submit"/>
</form>
} else {
<para>The stock price for <xsp:expr>symbol</xsp:expr> is
<xscript:variable name="soap-result">
<soap:call url="http://services.xmethods.net:80/soap">
<ns1:getQuote xmlns:ns1="urn:xmethods-delayed-quotes">
<soap:enc/>
<symbol xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema"><xsp-request:get-parameter name="symbol"/></symbol>
</ns1:getQuote>
</soap:call>
</xscript:variable>
<xscript:variable name="stylesheet">
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:n="urn:xmethods-delayed-quotes"
exclude-result-prefixes="soap n">
<xsl:template match="/">
<b>
<xsl:value-of select="/soap:Envelope/soap:Body/n:getQuoteResponse/Result"/>
</b>
</xsl:template>
</xsl:stylesheet>
</xscript:variable>
<xscript:transform name="soap-result" stylesheet="stylesheet"/>
</para>
<form href="soap-getquote">
<input value="Back" type="submit"/>
</form>
}
</xsp:logic>
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/xscript/soap-getquote3.xsl
Index: soap-getquote3.xsl
===================================================================
<?xml version="1.0" encoding="utf-8"?>
<!--
Author: Ovidiu Predescu "ovidiu@cup.hp.com"
Date: October 9, 2001
-->
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:n="urn:xmethods-delayed-quotes"
exclude-result-prefixes="soap n"
>
<xsl:template match="/">
<b><xsl:value-of select="/soap:Envelope/soap:Body/n:getQuoteResponse/Result"/></b>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/xscript/soap-getquote3.xsp
Index: soap-getquote3.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- CVS: $Id: soap-getquote3.xsp,v 1.1 2002/07/02 13:06:39 cziegeler Exp $ -->
<!--
Author: Ovidiu Predescu "ovidiu@cup.hp.com"
Date: October 9, 2001
-->
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
xmlns:xscript="http://apache.org/xsp/xscript/1.0"
xmlns:soap="http://apache.org/xsp/soap/3.0">
<page>
<title>SOAP Stock Quote Example 3</title>
<content>
<xsp:logic>
String symbol = request.getParameter("symbol");
if (symbol == null || symbol.equals("")) {
<para>This page demonstrates the SOAP logicsheet for
Cocoon2. It accesses a SOAP service that provides stock quotes
and displays the result.</para>
<para>This is yet another example of the XScript and SOAP
logicsheets. This sample is very similar with
<code>soap-getquote2.xsp</code>, except that the stylesheet is
defined in an external file.
</para>
<para>Please enter the stock ticker: </para>
<form href="soap-getquote">
<input name="symbol" type="text" value="HPQ"/>
<input value="Do it!" type="submit"/>
</form>
} else {
<para>
The stock price for <xsp:expr>symbol</xsp:expr> is
<xscript:variable name="soap-result">
<soap:call url="http://services.xmethods.net:80/soap">
<ns1:getQuote xmlns:ns1="urn:xmethods-delayed-quotes">
<soap:enc/>
<symbol xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema"><xsp-request:get-parameter name="symbol"/></symbol>
</ns1:getQuote>
</soap:call>
</xscript:variable>
<xscript:variable name="stylesheet"
href="docs/samples/xscript/soap-getquote3.xsl"/>
<xscript:transform name="soap-result" stylesheet="stylesheet"/>
</para>
<form href="soap-getquote">
<input value="Back" type="submit"/>
</form>
}
</xsp:logic>
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/xsp/aggregate.xsp
Index: aggregate.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- CVS: $Id: aggregate.xsp,v 1.1 2002/07/02 13:06:39 cziegeler Exp $ -->
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:cinclude="http://apache.org/cocoon/include/1.0">
<xsp:logic>
/**
* Generate the unique key.
* This key must be unique inside the space of this XSP page.
* This method will be invoked before the generateValidity() method.
*
* @return The generated key or 0 if the component
* is currently not cacheable.
*/
public long generateKey()
{
return 1;
}
/**
* Generate the validity object.
*
* @return The generated validity object or <code>null</code> if the
* component is currently not cacheable.
*/
public org.apache.cocoon.caching.CacheValidity generateValidity() {
return new org.apache.cocoon.caching.NOPCacheValidity();
}
</xsp:logic>
<page>
<title>A Simple XSP Page using Content Aggregation</title>
<content>
<para>
<cinclude:include src="cocoon:/news/slashdot.xml" element="slashdot" ns="http://foo.bar.com/slashdot"/>
</para>
<para>
<cinclude:include src="cocoon:/news/moreover.xml" element="moreover" ns="http://foo.bar.com/moreover"/>
</para>
<para>
<cinclude:include src="cocoon:/news/xmlhack.xml" element="isyndicate" ns="http://foo.bar.com/xmlhack"/>
</para>
<para>Brought to you by Cocoon at <xsp:expr>new Date()</xsp:expr>.</para>
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/xsp/cacheable.xsp
Index: cacheable.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- CVS: $Id: cacheable.xsp,v 1.1 2002/07/02 13:06:39 cziegeler Exp $ -->
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0">
<xsp:structure>
<xsp:include>org.apache.cocoon.caching.CacheValidity</xsp:include>
<xsp:include>org.apache.cocoon.caching.DeltaTimeCacheValidity</xsp:include>
<xsp:include>org.apache.cocoon.util.HashUtil</xsp:include>
</xsp:structure>
<xsp:logic>
/**
* Generate the unique key.
* This key must be unique inside the space of this XSP page.
* This method will be invoked before the generateValidity() method.
*
* @return The generated key or 0 if the component
* is currently not cacheable.
*/
public long generateKey()
{
// Generate unique key; add parameters' values here
return HashUtil.hash("" + request.getParameter("param"));
}
/**
* Generate the validity object.
* Before this method can be invoked the generateKey() method
* will be invoked.
*
* @return The generated validity object or null if the
* component is currently not cacheable.
*/
public CacheValidity generateValidity() {
// Check all dependencies here
return new DeltaTimeCacheValidity(0, 5);
}
</xsp:logic>
<page>
<title>A Cacheable XSP Page</title>
<content>
<para>Hi there! I'm a simple dynamic page generated by XSP
(eXtensible Server Pages).</para>
<para>I'm cached for every different value of request parameter
'param'. Value is: <b>
<xsp-request:get-parameter name="param"/>
</b></para>
<para>All other request parameters do not influence cache status, but
my validity will expire after 5 sec (see source).
Value of parameter 'other' is: <b>
<xsp-request:get-parameter name="other"/></b>
</para>
<para>Links:
<ul>
<li><a href="cacheable?param=one">param=one</a></li>
<li><a href="cacheable?param=two">param=two</a></li>
<li><a href="cacheable?param=three&other=abc">param=three, other=abc</a></li>
<li><a href="cacheable?param=three&other=xyz">param=three, other=xyz</a></li>
</ul>
Try two last links with delay 5 sec; and try without delay.
</para>
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/xsp/cookie.xsp
Index: cookie.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- CVS: $Id: cookie.xsp,v 1.1 2002/07/02 13:06:39 cziegeler Exp $ -->
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-cookie="http://apache.org/xsp/cookie/2.0"
xmlns:xsp-request="http://apache.org/xsp/request/2.0">
<xsp:structure>
<xsp:include>org.apache.cocoon.environment.Cookie</xsp:include>
</xsp:structure>
<page>
<title>COOKIE LOGIC SHEET TEST1</title>
<br>Trying to generate a cookie with name=testname, value=testvalue, maxage=10 years </br>
<xsp:logic>
String testname = "testname";
String testvalue = "testvalue";
</xsp:logic>
<!-- Create cookie using constant name -->
<xsp-cookie:cookie>
<xsp-cookie:name>testname1</xsp-cookie:name>
<xsp-cookie:value>testvalue1</xsp-cookie:value>
<xsp-cookie:setMaxAge><xsp:expr>10*365*24*60*60</xsp:expr></xsp-cookie:setMaxAge>
</xsp-cookie:cookie>
<!-- Create cookie using Java variable name -->
<xsp-cookie:cookie>
<xsp-cookie:name><xsp:expr>testname</xsp:expr></xsp-cookie:name>
<xsp-cookie:value><xsp:expr>testvalue</xsp:expr></xsp-cookie:value>
<xsp-cookie:setMaxAge><xsp:expr>10*365*24*60*60</xsp:expr></xsp-cookie:setMaxAge>
</xsp-cookie:cookie>
<br>Cookie Generated</br>
<br>***********</br>
<br> Cookies as XML </br>
<xsp-cookie:getCookies as="xml"/>
<br>***********</br>
<br> Single cookie as XML (using "name" attribute) </br>
<xsp-cookie:getCookie as="xml" name="testname"/>
<br>***********</br>
<br> Single cookie as XML (using "index" attribute) </br>
<textarea cols="60" rows="8"><xsp-cookie:getCookie as="xml" index="0"/></textarea>
<br>***********</br>
<br> Name of cookie by using index </br>
<xsp:logic>
String name = <xsp-cookie:getName index="0"/>;
</xsp:logic>
<cookiename><xsp:expr>name</xsp:expr></cookiename>
<br>***********</br>
<br> Comment of cookie by using name </br>
<xsp:logic>
String commentbyname = <xsp-cookie:getComment name="testname"/>;
</xsp:logic>
<cookiecommentname><xsp:expr>commentbyname</xsp:expr></cookiecommentname>
<br>***********</br>
<br> Comment of cookie by using index </br>
<xsp:logic>
String commentbyindex = <xsp-cookie:getComment index="0"/>;
</xsp:logic>
<cookiecommentindex><xsp:expr>commentbyindex</xsp:expr></cookiecommentindex>
<br>***********</br>
<br> Domain of cookie by using name </br>
<xsp:logic>
String domainbyname = <xsp-cookie:getDomain name="testname"/>;
</xsp:logic>
<cookiedomainname><xsp:expr>domainbyname</xsp:expr></cookiedomainname>
<br>***********</br>
<br> Domain of cookie by using index </br>
<xsp:logic>
String domainbyindex = <xsp-cookie:getDomain index="0"/>;
</xsp:logic>
<cookiedomainindex><xsp:expr>domainbyindex</xsp:expr></cookiedomainindex>
<br>***********</br>
<br> MaxAge of cookie by using name </br>
<xsp:logic>
String maxagebyname = <xsp-cookie:getMaxAge name="testname"/>;
</xsp:logic>
<cookiemaxagename><xsp:expr>maxagebyname</xsp:expr></cookiemaxagename>
<br>***********</br>
<br> MaxAge of cookie by using index </br>
<xsp:logic>
String maxagebyindex = <xsp-cookie:getMaxAge index="0"/>;
</xsp:logic>
<cookiemaxageindex><xsp:expr>maxagebyindex</xsp:expr></cookiemaxageindex>
<br>***********</br>
<br> Path of cookie by using name </br>
<xsp:logic>
String pathbyname = <xsp-cookie:getPath name="testname"/>;
</xsp:logic>
<cookiepathname><xsp:expr>pathbyname</xsp:expr></cookiepathname>
<br>***********</br>
<br> Path of cookie by using index </br>
<xsp:logic>
String pathbyindex = <xsp-cookie:getPath index="0"/>;
</xsp:logic>
<cookiepathindex><xsp:expr>pathbyindex</xsp:expr></cookiepathindex>
<br>***********</br>
<br> Secure of cookie by using name </br>
<xsp:logic>
String securebyname = <xsp-cookie:getSecure name="testname"/>;
</xsp:logic>
<cookiesecurename><xsp:expr>securebyname</xsp:expr></cookiesecurename>
<br>***********</br>
<br> Secure of cookie by using index </br>
<xsp:logic>
String securebyindex = <xsp-cookie:getSecure index="0"/>;
</xsp:logic>
<cookiesecureindex><xsp:expr>securebyindex</xsp:expr></cookiesecureindex>
<br>***********</br>
<br> Value of cookie by using name </br>
<xsp:logic>
String valuebyname = <xsp-cookie:getValue name="testname"/>;
</xsp:logic>
<cookievaluename><xsp:expr>valuebyname</xsp:expr></cookievaluename>
<br>***********</br>
<br> Value of cookie by using index </br>
<xsp:logic>
String valuebyindex = <xsp-cookie:getValue index="0"/>;
</xsp:logic>
<cookievalueindex><xsp:expr>valuebyindex</xsp:expr></cookievalueindex>
<br>***********</br>
<br> Version of cookie by using name </br>
<xsp:logic>
String versionbyname = <xsp-cookie:getVersion name="testname"/>;
</xsp:logic>
<cookievaluename><xsp:expr>versionbyname</xsp:expr></cookievaluename>
<br>***********</br>
<br> Value of cookie by using index </br>
<xsp:logic>
String versionbyindex = <xsp-cookie:getVersion index="0"/>;
</xsp:logic>
<cookievalueindex><xsp:expr>versionbyindex</xsp:expr></cookievalueindex>
<br>***********</br>
<xsp:logic>
Cookie cookie = <xsp-cookie:getCookie name="testname1"/>;
</xsp:logic>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/xsp/esql.xsd
Index: esql.xsd
===================================================================
<?xml version="1.0"?>
<!DOCTYPE schema SYSTEM "../../../../xdocs/dtd/XMLSchema.dtd">
<schema
xmlns="http://www.w3.org/2000/10/XMLSchema"
xmlns:esql="http://apache.org/cocoon/SQL/v2"
>
<element name="esql:connection">
<annotation>
<documentation>Opens a new database connection.</documentation>
</annotation>
<complexType>
<sequence>
<choice>
<sequence>
<!-- not schema strings - xsp strings -->
<element name="esql:driver" type="string">
<annotation>
<documentation>The name of the driver to use</documentation>
</annotation>
</element>
<element name="esql:dburl" type="string">
<annotation>
<documentation>The URL of the database</documentation>
</annotation>
</element>
<element name="esql:username" type="string" minOccurs="0" maxOccurs="1">
<annotation>
<documentation>The database user's name</documentation>
</annotation>
</element>
<element name="esql:password" type="string" minOccurs="0" maxOccurs="1">
<annotation>
<documentation>The database user's password</documentation>
</annotation>
</element>
</sequence>
<element name="esql:pool" type="string">
<annotation>
<documentation>The name of the database pool</documentation>
</annotation>
</element>
</choice>
<sequence>
<element name="esql:execute-query" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation>Executes a query on the database</documentation>
</annotation>
<complexType>
<sequence>
<element name="esql:query">
<annotation>
<documentation>The query to execute</documentation>
</annotation>
<complexType mixed="true">
<sequence>
<element name="esql:parameter" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation>A parameter for a prepared statement</documentation>
</annotation>
</element>
</sequence>
</complexType>
</element>
<element name="esql:results" minOccurs="0" maxOccurs="1">
<annotation>
<documentation>This element's children are instantiated in the result tree when the query returns a resultset</documentation>
</annotation>
<complexType mixed="true">
<sequence>
<element name="esql:row-results" minOccurs="0" maxOccurs="1">
<annotation>
<documentation>This element's children are instantiated in the result tree for each row in the resultset</documentation>
</annotation>
<complexType mixed="true">
<sequence>
<choice>
<any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
<element name="esql:get-columns" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation>Returns a sequence of elements whose names are the current row's column names, and whose values are the current row's column values</documentation>
</annotation>
<element name="esql:encoding" minOccurs="0" maxOccurs="1">
<annotation>
<documentation>The encoding used for this column, specified as a Java encoding
name.</documentation>
</annotation>
</element>
</element>
<element name="esql:get-string" minOccurs="0" maxOccurs="unbounded" type="EsqlColumnFunction">
<annotation>
<documentation>Returns the value of the given column in the current row as a string</documentation>
</annotation>
<element name="esql:encoding" minOccurs="0" maxOccurs="1">
<annotation>
<documentation>The encoding used for this column, specified as a Java encoding
name.</documentation>
</annotation>
</element>
</element>
<element name="esql:get-date" minOccurs="0" maxOccurs="unbounded" type="EsqlFormattedColumnFunction">
<annotation>
<documentation>Returns the value of the given column in the current row as a date</documentation>
</annotation>
</element>
<element name="esql:get-time" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation>Returns the value of the given column in the current row as a time</documentation>
</annotation>
</element>
<element name="esql:get-timestamp" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation>Returns the value of the given column in the current row as a timestamp</documentation>
</annotation>
</element>
<element name="esql:get-boolean" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation>Returns the value of the given column in the current row as a boolean</documentation>
</annotation>
</element>
<element name="esql:get-double" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation>Returns the value of the given column in the current row as a double</documentation>
</annotation>
</element>
<element name="esql:get-float" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation>Returns the value of the given column in the current row as a float</documentation>
</annotation>
</element>
<element name="esql:get-int" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation>Returns the value of the given column in the current row as a int</documentation>
</annotation>
</element>
<element name="esql:get-long" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation>Returns the value of the given column in the current row as a long</documentation>
</annotation>
</element>
<element name="esql:get-short" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation>Returns the value of the given column in the current row as a short</documentation>
</annotation>
</element>
<element name="esql:get-xml" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation>Parses the value of the given column in the current row as XML and returns it</documentation>
</annotation>
</element>
<element name="esql:get-row-position" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation>Returns the position of the current row in the resultset</documentation>
</annotation>
</element>
<element name="esql:get-column-name" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation>Returns the name of the given column in the current row</documentation>
</annotation>
</element>
<element name="esql:get-column-label" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation>Returns the label of the given column in the current row</documentation>
</annotation>
</element>
<element name="esql:get-column-type-name" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation>Returns the type name of the given column in the current row</documentation>
</annotation>
</element>
</choice>
</sequence>
</complexType>
</element>
<element name="esql:no-results" minOccurs="0" maxOccurs="1">
<annotation>
<documentation>This element's children are instantiated in the result tree for each row in the resultset</documentation>
</annotation>
</element>
</sequence>
</complexType>
</element>
<element name="esql:update-results" minOccurs="0" maxOccurs="1">
<annotation>
<documentation>This element's children are instantiated in the result tree if the query returns a number of rows</documentation>
</annotation>
</element>
<element name="esql:error-results" minOccurs="0" maxOccurs="1">
<annotation>
<documentation>This element's children are instantiated in the result tree if the query results in a database error. If this element does not exist, the error is passed on to the xsp layer. If it does exist, the error is caught here unless passed on explicitly.</documentation>
</annotation>
</element>
</sequence>
</complexType>
</element>
</sequence>
</sequence>
</complexType>
</element>
<complexType name="EsqlColumnFunction">
<annotation>
<documentation>The given column is indicated by the column attribute. If the attribute's value is an integer, it is treated as the index of the column in the row, otherwise it's value is treated as the name of the column.</documentation>
</annotation>
<attribute name="column" type="string"/>
</complexType>
<complexType name="EsqlFormattedColumnFunction">
<annotation>
<documentation>The value of the format attribute can used by some column value functions (e.g. date, real) as a template for formatting the column value. This is necessarily implementation dependent.</documentation>
</annotation>
<complexContent>
<extension base="EsqlColumnFunction">
<attribute name="format" type="string"/>
</extension>
</complexContent>
</complexType>
</schema>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/xsp/esql.xsp
Index: esql.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- CVS: $Id: esql.xsp,v 1.1 2002/07/02 13:06:39 cziegeler Exp $ -->
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:esql="http://apache.org/cocoon/SQL/v2">
<page>
<title>A Database Driven XSP Page</title>
<content>
<esql:connection>
<esql:pool>personnel</esql:pool>
<esql:execute-query>
<esql:query>select * from department</esql:query>
<esql:results>
<esql:row-results>
<para><esql:get-string column="name"/></para>
<esql:get-columns/>
</esql:row-results>
</esql:results>
</esql:execute-query>
<hr/>
<para>
Below departments and employees are printed. This uses the grouping
feature in esql.
</para>
<esql:execute-query>
<esql:query>
SELECT department.name, employee.id, employee.name as empName FROM department, employee
WHERE department.id = employee.department_id ORDER BY department.name
</esql:query>
<esql:results>
<esql:row-results>
<esql:group group-on='name'><!-- grouping -->
<Department>
<xsp:attribute name='name'><esql:get-string column='name'/></xsp:attribute>
<h2><esql:get-string column='name'/></h2>
<esql:member><!-- grouping -->
<para><employee><esql:get-string column='empName'/></employee></para>
</esql:member><!--grouping -->
</Department>
</esql:group><!-- grouping -->
</esql:row-results>
</esql:results>
</esql:execute-query>
<hr/>
<para>
Without the grouping feature, the result would look like this:
</para>
<esql:execute-query>
<esql:query>
SELECT department.name, employee.id, employee.name as empName FROM department, employee
WHERE department.id = employee.department_id ORDER BY department.name
</esql:query>
<esql:results>
<esql:row-results>
<Department>
<xsp:attribute name='name'><esql:get-string column='name'/></xsp:attribute>
<h2><esql:get-string column='name'/></h2>
<para><employee><esql:get-string column='empName'/></employee></para>
</Department>
</esql:row-results>
</esql:results>
</esql:execute-query>
</esql:connection>
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/xsp/hello.xsp
Index: hello.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- CVS: $Id: hello.xsp,v 1.1 2002/07/02 13:06:39 cziegeler Exp $ -->
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp">
<page>
<title>Hello</title>
<content>
<para>This is my first Cocoon page!</para>
<xsp:element name="para">
With the help of XSP and
<xsp:expr>Constants.COMPLETE_NAME</xsp:expr>
</xsp:element>
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/xsp/logicsheet.xsp
Index: logicsheet.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- CVS: $Id: logicsheet.xsp,v 1.1 2002/07/02 13:06:39 cziegeler Exp $ -->
<!-- XSP can be assotiated with the logicsheet using processing
instruction xml-logicsheet or the xsp:logicsheet element.
Do not use both methods!
<?xml-logicsheet href="logicsheets/hello.xsl"?>
-->
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
xmlns:xsp-hello="http://apache.org/xsp/hello/1.0">
<xsp:logicsheet location="logicsheets/hello.xsl"/>
<!-- Context URL also can be used:
<xsp:logicsheet location="context://logicsheets/hello.xsl"/>
URL relative to the current sitemap CAN NOT be used, as
logicsheet is the global object, shared between all sitemaps.
-->
<page>
<title>Greetings Page</title>
<content>
<xsp:logic>
String name = <xsp-request:get-parameter name="name"/>;
if (name == null) {
<para>
<!-- Print default greeting -->
<xsp-hello:greeting name="Unknown"/>
<form action="logicsheet">
Please enter your name: <input name="name"/> <input type="submit"/>
</form>
</para>
} else {
<para>
<!-- Override default greeting -->
<xsp-hello:greeting value="Welcome to this small logicsheet sample">
<!-- Alternate way of specifying name attribute -->
<xsp-hello:name><xsp:expr>name</xsp:expr></xsp-hello:name>
</xsp-hello:greeting>
</para>
<para>
This greeting above was created using simple logicsheet.
</para>
}
</xsp:logic>
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/xsp/request.xsp
Index: request.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- CVS: $Id: request.xsp,v 1.1 2002/07/02 13:06:39 cziegeler Exp $ -->
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0">
<page>
<!-- Test set attribute using Java variable -->
<xsp:logic>
String attribute= "Test Attribute Value!";
</xsp:logic>
<xsp-request:set-attribute name="attr"><xsp:expr>attribute</xsp:expr></xsp-request:set-attribute>
<!-- Test set attribute using constant -->
<xsp-request:set-attribute name="attr">Test Attribute Value!!!</xsp-request:set-attribute>
<h1>xsp-request logicsheet output</h1>
<table border="1">
<tr>
<th>Logicsheet tag</th><th>Output</th><th>Java method</th><th>Output</th></tr>
<tr>
<td>get-uri</td><td><xsp-request:get-uri/></td>
<td>getRequestURI</td><td><xsp:expr>request.getRequestURI()</xsp:expr></td>
</tr>
<tr>
<td>get-sitemap-uri</td><td><xsp-request:get-sitemap-uri/></td>
</tr>
<tr>
<td>get-scheme</td><td><xsp-request:get-scheme/></td>
<td>getScheme</td><td><xsp:expr>request.getScheme()</xsp:expr></td>
</tr>
<tr>
<td>get-character-encoding</td><td><xsp-request:get-character-encoding/></td>
<td>getCharacterEncoding</td><td><xsp:expr>request.getCharacterEncoding()</xsp:expr></td>
</tr>
<tr>
<td>get-content-length</td><td><xsp-request:get-content-length/></td>
<td>getContentLength</td><td><xsp:expr>request.getContentLength()</xsp:expr></td>
</tr>
<tr>
<td>get-content-type</td><td><xsp-request:get-content-type/></td>
<td>getContentType</td><td><xsp:expr>request.getContentType()</xsp:expr></td>
</tr>
<tr>
<td>get-locale</td><td><xsp-request:get-locale/></td>
<td>getLocale</td><td><xsp:expr>request.getLocale()</xsp:expr></td>
</tr>
<tr>
<td>get-locales</td><td><xsp:expr>String.valueOf(<xsp-request:get-locales as="array"/>)</xsp:expr></td>
<td>getLocales</td><td><xsp:expr>String.valueOf(request.getLocales())</xsp:expr></td>
</tr>
<tr>
<td>get-parameter</td><td><xsp-request:get-parameter name="param"/></td>
<td>getParameter</td><td><xsp:expr>request.getParameter("param")</xsp:expr></td>
</tr>
<tr>
<td>get-parameter with default </td><td><xsp-request:get-parameter name="param" default="default"/></td>
</tr>
<tr>
<td>get-parameter-values (as array)</td><td><xsp:expr>String.valueOf(<xsp-request:get-parameter-values name="param" as="array"/>)</xsp:expr></td>
<td>getParameterValues</td><td><xsp:expr>String.valueOf(request.getParameterValues("param"))</xsp:expr></td>
</tr>
<tr>
<td>get-parameter-names (as array)</td><td><xsp:expr>String.valueOf(<xsp-request:get-parameter-names as="array"/>)</xsp:expr></td>
<td>getParameterNames</td><td><xsp:expr>String.valueOf(request.getParameterNames())</xsp:expr></td>
</tr>
<tr>
<td>get-header accept</td><td><xsp-request:get-header name="accept"/></td>
<td>getHeader</td><td><xsp:expr>request.getHeader("accept")</xsp:expr></td>
</tr>
<tr>
<td>get-header user-agent</td><td><xsp-request:get-header name="user-agent"/></td>
<td>getHeader</td><td><xsp:expr>request.getHeader("user-agent")</xsp:expr></td>
</tr>
<!--
get-int-header
get-date-header
-->
<tr>
<td>get-headers accept-language (as array)</td><td><xsp:expr>String.valueOf(<xsp-request:get-headers name="accept-language" as="array"/>)</xsp:expr></td>
<td>getHeaders</td><td><xsp:expr>request.getHeaders("accept-language")</xsp:expr></td>
</tr>
<tr>
<td>get-header-names (as array)</td><td><xsp:expr>String.valueOf(<xsp-request:get-header-names as="array"/>)</xsp:expr></td>
<td>getHeaderNames</td><td><xsp:expr>String.valueOf(request.getHeaderNames())</xsp:expr></td>
</tr>
<tr>
<td>get-attribute attr</td><td><xsp-request:get-attribute name="attr"/></td>
<td>getAttribute</td><td><xsp:expr>request.getAttribute("attr")</xsp:expr></td>
</tr>
<tr>
<td>get-attribute-names (as array)</td><td><xsp:expr>String.valueOf(<xsp-request:get-attribute-names as="array"/>)</xsp:expr></td>
<td>getAttributeNames</td><td><xsp:expr>String.valueOf(request.getAttributeNames())</xsp:expr></td>
</tr>
<tr>
<td>get-requested-url</td><td><xsp-request:get-requested-url/></td>
</tr>
<tr>
<td>get-remote-address</td><td><xsp-request:get-remote-address/></td>
<td>getRemoteAddr</td><td><xsp:expr>request.getRemoteAddr()</xsp:expr></td>
</tr>
<tr>
<td>get-remote-user</td><td><xsp-request:get-remote-user/></td>
<td>getRemoteUser</td><td><xsp:expr>request.getRemoteUser()</xsp:expr></td>
</tr>
<tr>
<td>get-context-path</td><td><xsp-request:get-context-path/></td>
<td>getContextPath</td><td><xsp:expr>request.getContextPath()</xsp:expr></td>
</tr>
<tr>
<td>get-path-info</td><td><xsp-request:get-path-info/></td>
<td>getPathInfo</td><td><xsp:expr>request.getPathInfo()</xsp:expr></td>
</tr>
<tr>
<td>get-server-name</td><td><xsp-request:get-server-name/></td>
<td>getServerName</td><td><xsp:expr>request.getServerName()</xsp:expr></td>
</tr>
<tr>
<td>get-server-port</td><td><xsp-request:get-server-port/></td>
<td>getServerPort</td><td><xsp:expr>request.getServerPort()</xsp:expr></td>
</tr>
<tr>
<td>get-method</td><td><xsp-request:get-method/></td>
<td>getMethod</td><td><xsp:expr>request.getMethod()</xsp:expr></td>
</tr>
<tr>
<td>get-query-string</td><td><xsp-request:get-query-string/></td>
<td>getQueryString</td><td><xsp:expr>request.getQueryString()</xsp:expr></td>
</tr>
<tr>
<td>get-protocol</td><td><xsp-request:get-protocol/></td>
<td>getProtocol</td><td><xsp:expr>request.getProtocol()</xsp:expr></td>
</tr>
<tr>
<td>get-remote-host</td><td><xsp-request:get-remote-host/></td>
<td>getRemoteHost</td><td><xsp:expr>request.getRemoteHost()</xsp:expr></td>
</tr>
<tr>
<td>is-secure</td><td><xsp-request:is-secure/></td>
<td>isSecure</td><td><xsp:expr>request.isSecure()</xsp:expr></td>
</tr>
<tr>
<td>get-servlet-path</td><td><xsp-request:get-servlet-path/></td>
<td>getServletPath</td><td><xsp:expr>request.getServletPath()</xsp:expr></td>
</tr>
<tr>
<td>get-user-principal</td><td><xsp-request:get-user-principal/></td>
<td>getUserPrincipal</td><td><xsp:expr>request.getUserPrincipal()</xsp:expr></td>
</tr>
<tr>
<td>get-auth-type</td><td><xsp-request:get-auth-type/></td>
<td>getAuthType</td><td><xsp:expr>request.getAuthType()</xsp:expr></td>
</tr>
<tr>
<td>is-user-in-role</td><td><xsp-request:is-user-in-role role="admin"/></td>
<td>isUserInRole</td><td><xsp:expr>request.isUserInRole("admin")</xsp:expr></td>
</tr>
<tr>
<td>get-requested-session-id</td><td><xsp-request:get-requested-session-id/></td>
<td>getRequestedSessionId</td><td><xsp:expr>request.getRequestedSessionId()</xsp:expr></td>
</tr>
</table>
<h1>xsp-request logicsheet output (as xml)</h1>
<textarea cols="100" rows="30">
get-uri <xsp-request:get-uri as="xml"/>
get-sitemap-uri <xsp-request:get-sitemap-uri as="xml"/>
get-scheme <xsp-request:get-scheme as="xml"/>
get-character-encoding <xsp-request:get-character-encoding as="xml"/>
get-content-length <xsp-request:get-content-length as="xml"/>
get-content-type <xsp-request:get-content-type as="xml"/>
get-locale <xsp-request:get-locale as="xml"/>
get-locales <xsp-request:get-locales as="xml"/>
get-parameter <xsp-request:get-parameter name="param" as="xml"/>
get-parameter with default <xsp-request:get-parameter name="param" default="default" as="xml"/>
get-parameter-values <xsp-request:get-parameter-values name="param" as="xml"/>
get-parameter-names <xsp-request:get-parameter-names as="xml"/>
get-header accept <xsp-request:get-header name="accept" as="xml"/>
get-header user-agent <xsp-request:get-header name="user-agent" as="xml"/>
get-header-names <xsp-request:get-header-names as="xml"/>
get-int-header - no sample
get-date-header - no sample
get-headers <xsp-request:get-headers name="accept-language" as="xml"/>
get-attribute attr <xsp-request:get-attribute name="attr" as="xml"/>
get-attribute-names <xsp-request:get-attribute-names as="xml"/>
get-requested-url <xsp-request:get-requested-url as="xml"/>
get-remote-address <xsp-request:get-remote-address as="xml"/>
get-remote-user <xsp-request:get-remote-user as="xml"/>
get-context-path <xsp-request:get-context-path as="xml"/>
get-path-info <xsp-request:get-path-info as="xml"/>
get-server-name <xsp-request:get-server-name as="xml"/>
get-server-port <xsp-request:get-server-port as="xml"/>
get-method <xsp-request:get-method as="xml"/>
get-query-string <xsp-request:get-query-string as="xml"/>
get-protocol <xsp-request:get-protocol as="xml"/>
get-remote-host <xsp-request:get-remote-host as="xml"/>
is-secure <xsp-request:is-secure as="xml"/>
get-servlet-path <xsp-request:get-servlet-path as="xml"/>
get-user-principal <xsp-request:get-user-principal as="xml"/>
get-auth-type <xsp-request:get-auth-type as="xml"/>
is-user-in-role <xsp-request:is-user-in-role role="admin" as="xml"/>
get-requested-session-id <xsp-request:get-requested-session-id as="xml"/>
</textarea>
<xsp-request:remove-attribute name="attr"/>
<h2>Links</h2>
<a href="request?param=value&a=b&x=y">Get</a>
<br/>
<form method="post" action="request">
<input name="param"/>
<input type="submit" value="Post"/>
</form>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/xsp/resolver.xsp
Index: resolver.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:util="http://apache.org/xsp/util/2.0"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
>
<xsp:structure>
<xsp:include>org.apache.cocoon.components.parser.Parser</xsp:include>
<xsp:include>org.apache.cocoon.environment.Source</xsp:include>
<xsp:include>org.apache.cocoon.xml.IncludeXMLConsumer</xsp:include>
<xsp:include>java.io.InputStream</xsp:include>
<xsp:include>java.io.BufferedInputStream</xsp:include>
<xsp:include>java.lang.Long</xsp:include>
</xsp:structure>
<page>
<title>An XSP Page using a source</title>
<content>
<!--
<p>
this is the source code of this page: <xsp-request:get-sitemap-uri/>
</p>
<table align="center" width="90%" bgcolor="#d0FFFF" border="1">
<tr>
<td>
<pre>
<util:get-source>
<util:param name="uri">cocoon://view-xsource?filename=/docs/samples/<xsp-request:get-sitemap-uri/>.xsp</util:param>
</util:get-source>
</pre>
</td>
</tr>
</table>
-->
<!-- obtain an InputSource instead of an InputStream -->
<p>
this is the source code of this page:
</p>
<table align="center" width="90%" bgcolor="#d0FFFF" border="1">
<tr>
<td>
<util:include-source><util:param name="uri">cocoon://view-xsource?filename=/docs/samples/<xsp-request:get-sitemap-uri/>.xsp</util:param></util:include-source>
</td>
</tr>
</table>
<!-- -->
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/xsp/response.xsp
Index: response.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- CVS: $Id: response.xsp,v 1.1 2002/07/02 13:06:39 cziegeler Exp $ -->
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-response="http://apache.org/xsp/response/2.0">
<page>
<h1>xsp-response logicsheet output</h1>
<table border="1">
<tr>
<th>Logicsheet tag</th><th>Output</th><th>Java method</th><th>Output</th></tr>
<tr>
<td>get-character-encoding</td><td><xsp-response:get-character-encoding/></td>
<td>getCharacterEncoding</td><td><xsp:expr>response.getCharacterEncoding()</xsp:expr></td>
</tr>
<tr>
<td>get-locale</td><td><xsp-response:get-locale/></td>
<td>getLocale</td><td><xsp:expr>response.getLocale()</xsp:expr></td>
</tr>
<tr>
<td>set-locale to GERMANY</td><td>
<xsp-response:set-locale><xsp:expr>java.util.Locale.GERMANY</xsp:expr></xsp-response:set-locale>
</td>
</tr>
<tr>
<td>get-locale</td><td><xsp-response:get-locale/></td>
<td>getLocale</td><td><xsp:expr>response.getLocale()</xsp:expr></td>
</tr>
<xsp-response:set-locale><xsp:expr>java.util.Locale.getDefault()</xsp:expr></xsp-response:set-locale>
<tr>
<td>add-date-header</td><td>
<xsp-response:add-date-header name="X-Cocoon-Date">
<xsp-response:date><xsp:expr>new Date()</xsp:expr></xsp-response:date>
</xsp-response:add-date-header></td>
<td>addDateHeader</td><td><xsp:logic>response.addDateHeader("X-Java-Date", System.currentTimeMillis());</xsp:logic></td>
</tr>
<tr>
<td>add-header</td><td>
<xsp-response:add-header name="X-Cocoon-Header" value="Value!"/>
</td>
<td>addHeader</td><td><xsp:logic>response.addHeader("X-Java-Header", "Value!");</xsp:logic></td>
</tr>
<tr>
<td>add-int-header</td><td>
<xsp-response:add-int-header name="X-Cocoon-Int">
<xsp-response:value><xsp:expr>5</xsp:expr></xsp-response:value>
</xsp-response:add-int-header></td>
<td>addIntHeader</td><td><xsp:logic>response.addIntHeader("X-Java-Int", 5);</xsp:logic></td>
</tr>
<tr>
<td>contains-header</td><td>
<xsp-response:contains-header name="X-Cocoon-Header"/>
</td>
<td>containsHeader</td><td><xsp:expr>response.containsHeader("X-Java-Header")</xsp:expr></td>
</tr>
<tr>
<td>encode-url</td><td>
<xsp-response:encode-url url="http://localhost:8080/cocoon/welcome"/>
</td>
<td>encodeURL</td><td><xsp:expr>response.encodeURL("http://localhost:8080/cocoon/welcome")</xsp:expr></td>
</tr>
<!--
xsp-response:add-cookie
xsp-response:set-date-header
xsp-response:set-header
xsp-response:set-int-header
-->
</table>
<h1>xsp-response logicsheet output (as xml)</h1>
<textarea cols="100" rows="12">
get-character-encoding <xsp-response:get-character-encoding as="xml"/>
get-locale <xsp-response:get-locale as="xml"/>
contains-header <xsp-response:contains-header name="X-Cocoon-Header" as="xml"/>
encode-url <xsp-response:encode-url url="http://localhost:8080/cocoon/welcome" as="xml"/>
</textarea>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/xsp/session.xsp
Index: session.xsp
===================================================================
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- CVS: $Id: session.xsp,v 1.1 2002/07/02 13:06:39 cziegeler Exp $ -->
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-session="http://apache.org/xsp/session/2.0"
create-session="yes">
<page>
<p>Adding attribute attr1='Test Value!'.</p>
<xsp-session:set-attribute name="attr1">Test value!</xsp-session:set-attribute>
<p>Set max inactive interval to 500</p>
<xsp-session:set-max-inactive-interval interval="500"/>
<h1>xsp-session logicsheet output</h1>
<table border="1">
<tr>
<th>Logicsheet tag</th><th>Output</th></tr>
<tr>
<td>get-session-id</td><td><xsp-session:get-session-id/></td></tr>
<tr>
<td>get-attribute</td><td><xsp-session:get-attribute name="attr1"/></td></tr>
<tr>
<td>get-attribute-names</td><td><xsp:expr><xsp-session:get-attribute-names as="array"/></xsp:expr></td></tr>
<tr>
<td>get-creation-time</td><td><xsp-session:get-creation-time/></td></tr>
<tr>
<td>get-creation-time (string)</td><td><xsp-session:get-creation-time as="string"/></td></tr>
<tr>
<td>get-id</td><td><xsp-session:get-id/></td></tr>
<tr>
<td>get-last-accessed-time</td><td><xsp-session:get-last-accessed-time/></td></tr>
<tr>
<td>get-last-accessed-time (string)</td><td><xsp-session:get-last-accessed-time as="string"/></td></tr>
<tr>
<td>get-max-inactive-interval</td><td><xsp-session:get-max-inactive-interval/></td></tr>
<tr>
<td>is-new</td><td><xsp-session:is-new/></td></tr>
</table>
<h1>xsp-session logicsheet output (as xml)</h1>
<textarea cols="100" rows="20">
get-session-id <xsp-session:get-session-id as="xml"/>
get-attribute <xsp-session:get-attribute name="attr1" as="xml"/>
get-attribute-names <xsp-session:get-attribute-names as="xml"/>
get-creation-time <xsp-session:get-creation-time as="xml"/>
get-id <xsp-session:get-id as="xml"/>
get-last-accessed-time <xsp-session:get-last-accessed-time as="xml"/>
get-max-inactive-interval <xsp-session:get-max-inactive-interval as="xml"/>
is-new <xsp-session:is-new as="xml"/>
encode-url <xsp-session:encode-url href="../"/>
form-encode-url <xsp-session:form-encode-url href="../"/>
</textarea>
<p>Removing attribute attr1</p>
<xsp-session:remove-attribute name="attr1"/>
<p>Invalidating session</p>
<xsp-session:invalidate/>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/xsp/sessionpage.xsp
Index: sessionpage.xsp
===================================================================
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- CVS: $Id: sessionpage.xsp,v 1.1 2002/07/02 13:06:39 cziegeler Exp $ -->
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-session="http://apache.org/xsp/session/2.0"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
create-session="yes">
<!-- a simple session page by J�rg Prante <jo...@7val.com> -->
<page>
<title>A Simple URI-based Session Example</title>
<content>
<para> <xsp-request:get-uri as="xml"/> </para>
<para> Session ID = <xsp-session:get-id as="xml"/> </para>
<para>
Encode URL Test =
<xsp-session:encode-url href="sessionpage">Follow me!</xsp-session:encode-url>
</para>
<para>Session parameter "my-param" is <xsp-session:get-attribute name="my-param" default="not set"/></para>
<!-- set my-param for future visits to page -->
<xsp-session:set-attribute name="my-param">set</xsp-session:set-attribute>
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/xsp/simple.xsp
Index: simple.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- CVS: $Id: simple.xsp,v 1.1 2002/07/02 13:06:39 cziegeler Exp $ -->
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
xmlns:log="http://apache.org/xsp/log/2.0"
xmlns:capture="http://apache.org/cocoon/capture/1.0">
<page>
<log:logger name="xsp-sample" filename="xsp-sample.log"/>
<log:debug>Processing the beginning of the page</log:debug>
<title>A Simple XSP Page</title>
<content>
<capture:fragment-variable name="page_part">
<para>These 2 paragraphs were generated at the start of the XSP, and captured for insertion at the end.</para>
<para>Brought to you by Cocoon at <xsp:expr>new Date()</xsp:expr>.</para>
</capture:fragment-variable>
<para>Hi there! I'm a simple dynamic page generated by XSP (eXtensible Server Pages).</para>
<para>I was requested as the URI: <b><xsp-request:get-uri as="xml"/></b></para>
<para>The following list was dynamically generated:</para>
<ul>
<xsp:logic>
<![CDATA[
for (int i=0; i<3; i++) {
]]>
<li>
Item <xsp:expr>i</xsp:expr>
</li>
<![CDATA[
}
]]>
</xsp:logic>
</ul>
<xsp:element>
<xsp:param name="name"><xsp:expr>"P".toLowerCase()</xsp:expr></xsp:param>
<xsp:attribute name="align">left</xsp:attribute>
<i>
This paragraph was dynamically generated by logic embedded in the page
</i>
</xsp:element>
<para>
Request parameter "name" as XML:
<xsp-request:get-parameter name="name" default="Not provided" as="xml"/>
</para>
<para>
Request parameter "name" as String:
<xsp-request:get-parameter name="name" default="Not provided"/>
</para>
<para>
Request parameter "name" as iso-8859-2 encoded String (with servlet
container encoding iso-8859-1):
<xsp-request:get-parameter name="name" default="Not provided"
form-encoding="iso-8859-2" container-encoding="iso-8859-1"/>
</para>
<xsp-request:get-parameter-values name="name"/>
<xsp-request:get-parameter-names/>
<para>
Header "user-agent" as XML:
<xsp-request:get-header name="user-agent" as="xml"/>
</para>
<para>
Header "user-agent" as String:
<xsp-request:get-header name="user-agent"/>
</para>
<xsp-request:get-header-names/>
<xsp:expr>page_part</xsp:expr>
</content>
<log:debug>Processing the end of the page</log:debug>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/xsp/upload.xsp
Index: upload.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- CVS: $Id: upload.xsp,v 1.1 2002/07/02 13:06:39 cziegeler Exp $ -->
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
xmlns:xsp-response="http://apache.org/xsp/response/2.0"
xmlns:log="http://apache.org/xsp/log/2.0">
<xsp:structure>
<xsp:include>org.apache.cocoon.components.language.markup.xsp.XSPUtil</xsp:include>
<xsp:include>org.apache.avalon.framework.context.ContextException</xsp:include>
</xsp:structure>
<xsp:logic>
File uploadDir = null;
/** Contextualize this class */
public void contextualize(Context context) throws ContextException {
uploadDir = (File) context.get(Constants.CONTEXT_UPLOAD_DIR);
}
</xsp:logic>
<page>
<title>This form allows you upload files</title>
<content>
<para>
<form method="post" enctype="multipart/form-data" action="upload">
File: <input type="file" name="uploaded_file" size="50" />
<p><input type="submit" value="Upload File" /></p>
</form>
</para>
<para>
<ul>
<xsp:logic>
getLogger().debug("Dir=" + uploadDir);
String[] filelist = uploadDir.list();
<![CDATA[
getLogger().debug("List=" + filelist.length);
for (int i = 0; i < filelist.length; i++) {
getLogger().debug("File [" + i + "]=" + filelist[i]);
]]>
<li>
<xsp:expr>filelist[i]</xsp:expr>
</li>
<![CDATA[
}
]]>
</xsp:logic>
</ul>
</para>
<para>Brought to you by Cocoon at <xsp:expr>new Date()</xsp:expr>.</para>
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/xsp-js/hello.xsp
Index: hello.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- CVS: $Id: hello.xsp,v 1.1 2002/07/02 13:06:39 cziegeler Exp $ -->
<xsp:page language="javascript" xmlns:xsp="http://apache.org/xsp">
<page>
<title>Hello</title>
<content>
<para>This is my first Cocoon page!</para>
<xsp:element name="para">
With the help of XSP and Javascript!
</xsp:element>
<para>
<xsp:logic>
align = "center";
</xsp:logic>
<p>
<xsp:attribute name="align"><xsp:expr>align</xsp:expr></xsp:attribute>
<xsp:logic>
msg = "Executed at: ";
<xsp:content>
<xsp:expr>msg + new Date()</xsp:expr>
</xsp:content>
</xsp:logic>
</p>
</para>
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/xsp-js/request.xsp
Index: request.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- CVS: $Id: request.xsp,v 1.1 2002/07/02 13:06:39 cziegeler Exp $ -->
<xsp:page language="jsxsp"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0">
<page>
<xsp-request:set-attribute name="attr">Test Attribute Value</xsp-request:set-attribute>
<h1>xsp-request logicsheet output</h1>
<table border="1">
<tr>
<th>Logicsheet tag</th><th>Output</th><th>Java method</th><th>Output</th></tr>
<tr>
<td>get-uri</td><td><xsp-request:get-uri/></td>
<td>getRequestURI</td><td><xsp:expr>request.getRequestURI()</xsp:expr></td>
</tr>
<tr>
<td>get-sitemap-uri</td><td><xsp-request:get-sitemap-uri/></td>
</tr>
<tr>
<td>get-scheme</td><td><xsp-request:get-scheme/></td>
<td>getScheme</td><td><xsp:expr>request.getScheme()</xsp:expr></td>
</tr>
<tr>
<td>get-character-encoding</td><td><xsp-request:get-character-encoding/></td>
<td>getCharacterEncoding</td><td><xsp:expr>request.getCharacterEncoding()</xsp:expr></td>
</tr>
<tr>
<td>get-content-length</td><td><xsp-request:get-content-length/></td>
<td>getContentLength</td><td><xsp:expr>request.getContentLength()</xsp:expr></td>
</tr>
<tr>
<td>get-content-type</td><td><xsp-request:get-content-type/></td>
<td>getContentType</td><td><xsp:expr>request.getContentType()</xsp:expr></td>
</tr>
<tr>
<td>get-locale</td><td><xsp-request:get-locale/></td>
<td>getLocale</td><td><xsp:expr>request.getLocale()</xsp:expr></td>
</tr>
<tr>
<td>get-locales</td><td><xsp:expr>String(<xsp-request:get-locales as="array"/>)</xsp:expr></td>
<td>getLocales</td><td><xsp:expr>String(request.getLocales())</xsp:expr></td>
</tr>
<tr>
<td>get-parameter</td><td><xsp-request:get-parameter name="param"/></td>
<td>getParameter</td><td><xsp:expr>request.getParameter("param")</xsp:expr></td>
</tr>
<tr>
<td>get-parameter with default </td><td><xsp-request:get-parameter name="param" default="default"/></td>
</tr>
<tr>
<td>get-parameter-values (as array)</td><td><xsp:expr>String(<xsp-request:get-parameter-values name="param" as="array"/>)</xsp:expr></td>
<td>getParameterValues</td><td><xsp:expr>String(request.getParameterValues("param"))</xsp:expr></td>
</tr>
<tr>
<td>get-parameter-names (as array)</td><td><xsp:expr>String(<xsp-request:get-parameter-names as="array"/>)</xsp:expr></td>
<td>getParameterNames</td><td><xsp:expr>String(request.getParameterNames())</xsp:expr></td>
</tr>
<tr>
<td>get-header accept</td><td><xsp-request:get-header name="accept"/></td>
<td>getHeader</td><td><xsp:expr>request.getHeader("accept")</xsp:expr></td>
</tr>
<tr>
<td>get-header user-agent</td><td><xsp-request:get-header name="user-agent"/></td>
<td>getHeader</td><td><xsp:expr>request.getHeader("user-agent")</xsp:expr></td>
</tr>
<!--
get-int-header
get-date-header
-->
<tr>
<td>get-headers accept-language (as array)</td><td><xsp:expr>String(<xsp-request:get-headers name="accept-language" as="array"/>)</xsp:expr></td>
<td>getHeaders</td><td><xsp:expr>request.getHeaders("accept-language")</xsp:expr></td>
</tr>
<tr>
<td>get-header-names (as array)</td><td><xsp:expr>String(<xsp-request:get-header-names as="array"/>)</xsp:expr></td>
<td>getHeaderNames</td><td><xsp:expr>String(request.getHeaderNames())</xsp:expr></td>
</tr>
<tr>
<td>get-attribute attr</td><td><xsp-request:get-attribute name="attr"/></td>
<td>getAttribute</td><td><xsp:expr>request.getAttribute("attr")</xsp:expr></td>
</tr>
<tr>
<td>get-attribute-names (as array)</td><td><xsp:expr>String(<xsp-request:get-attribute-names as="array"/>)</xsp:expr></td>
<td>getAttributeNames</td><td><xsp:expr>String(request.getAttributeNames())</xsp:expr></td>
</tr>
<tr>
<td>get-requested-url</td><td><xsp-request:get-requested-url/></td>
</tr>
<tr>
<td>get-remote-address</td><td><xsp-request:get-remote-address/></td>
<td>getRemoteAddr</td><td><xsp:expr>request.getRemoteAddr()</xsp:expr></td>
</tr>
<tr>
<td>get-remote-user</td><td><xsp-request:get-remote-user/></td>
<td>getRemoteUser</td><td><xsp:expr>request.getRemoteUser()</xsp:expr></td>
</tr>
<tr>
<td>get-context-path</td><td><xsp-request:get-context-path/></td>
<td>getContextPath</td><td><xsp:expr>request.getContextPath()</xsp:expr></td>
</tr>
<tr>
<td>get-path-info</td><td><xsp-request:get-path-info/></td>
<td>getPathInfo</td><td><xsp:expr>request.getPathInfo()</xsp:expr></td>
</tr>
<tr>
<td>get-server-name</td><td><xsp-request:get-server-name/></td>
<td>getServerName</td><td><xsp:expr>request.getServerName()</xsp:expr></td>
</tr>
<tr>
<td>get-server-port</td><td><xsp-request:get-server-port/></td>
<td>getServerPort</td><td><xsp:expr>request.getServerPort()</xsp:expr></td>
</tr>
<tr>
<td>get-method</td><td><xsp-request:get-method/></td>
<td>getMethod</td><td><xsp:expr>request.getMethod()</xsp:expr></td>
</tr>
<tr>
<td>get-query-string</td><td><xsp-request:get-query-string/></td>
<td>getQueryString</td><td><xsp:expr>request.getQueryString()</xsp:expr></td>
</tr>
<tr>
<td>get-protocol</td><td><xsp-request:get-protocol/></td>
<td>getProtocol</td><td><xsp:expr>request.getProtocol()</xsp:expr></td>
</tr>
<tr>
<td>get-remote-host</td><td><xsp-request:get-remote-host/></td>
<td>getRemoteHost</td><td><xsp:expr>request.getRemoteHost()</xsp:expr></td>
</tr>
<tr>
<td>is-secure</td><td><xsp-request:is-secure/></td>
<td>isSecure</td><td><xsp:expr>request.isSecure()</xsp:expr></td>
</tr>
<tr>
<td>get-servlet-path</td><td><xsp-request:get-servlet-path/></td>
<td>getServletPath</td><td><xsp:expr>request.getServletPath()</xsp:expr></td>
</tr>
<tr>
<td>get-user-principal</td><td><xsp-request:get-user-principal/></td>
<td>getUserPrincipal</td><td><xsp:expr>request.getUserPrincipal()</xsp:expr></td>
</tr>
<tr>
<td>get-auth-type</td><td><xsp-request:get-auth-type/></td>
<td>getAuthType</td><td><xsp:expr>request.getAuthType()</xsp:expr></td>
</tr>
<tr>
<td>is-user-in-role</td><td><xsp-request:is-user-in-role role="admin"/></td>
<td>isUserInRole</td><td><xsp:expr>request.isUserInRole("admin")</xsp:expr></td>
</tr>
<tr>
<td>get-requested-session-id</td><td><xsp-request:get-requested-session-id/></td>
<td>getRequestedSessionId</td><td><xsp:expr>request.getRequestedSessionId()</xsp:expr></td>
</tr>
</table>
<h1>xsp-request logicsheet output (as xml)</h1>
<textarea cols="100" rows="30">
get-uri <xsp-request:get-uri as="xml"/>
get-sitemap-uri <xsp-request:get-sitemap-uri as="xml"/>
get-scheme <xsp-request:get-scheme as="xml"/>
get-character-encoding <xsp-request:get-character-encoding as="xml"/>
get-content-length <xsp-request:get-content-length as="xml"/>
get-content-type <xsp-request:get-content-type as="xml"/>
get-locale <xsp-request:get-locale as="xml"/>
get-locales <xsp-request:get-locales as="xml"/>
get-parameter <xsp-request:get-parameter name="param" as="xml"/>
get-parameter with default <xsp-request:get-parameter name="param" default="default" as="xml"/>
get-parameter-values <xsp-request:get-parameter-values name="param" as="xml"/>
get-parameter-names <xsp-request:get-parameter-names as="xml"/>
get-header accept <xsp-request:get-header name="accept" as="xml"/>
get-header user-agent <xsp-request:get-header name="user-agent" as="xml"/>
get-header-names <xsp-request:get-header-names as="xml"/>
get-int-header - no sample
get-date-header - no sample
get-headers - no sample
get-headers <xsp-request:get-headers name="accept-language" as="xml"/>
get-attribute attr <xsp-request:get-attribute name="attr" as="xml"/>
get-attribute-names <xsp-request:get-attribute-names as="xml"/>
get-requested-url <xsp-request:get-requested-url as="xml"/>
get-remote-address <xsp-request:get-remote-address as="xml"/>
get-remote-user <xsp-request:get-remote-user as="xml"/>
get-context-path <xsp-request:get-context-path as="xml"/>
get-path-info <xsp-request:get-path-info as="xml"/>
get-server-name <xsp-request:get-server-name as="xml"/>
get-server-port <xsp-request:get-server-port as="xml"/>
get-method <xsp-request:get-method as="xml"/>
get-query-string <xsp-request:get-query-string as="xml"/>
get-protocol <xsp-request:get-protocol as="xml"/>
get-remote-host <xsp-request:get-remote-host as="xml"/>
is-secure <xsp-request:is-secure as="xml"/>
get-servlet-path <xsp-request:get-servlet-path as="xml"/>
get-user-principal <xsp-request:get-user-principal as="xml"/>
get-auth-type <xsp-request:get-auth-type as="xml"/>
is-user-in-role <xsp-request:is-user-in-role role="admin" as="xml"/>
get-requested-session-id <xsp-request:get-requested-session-id as="xml"/>
</textarea>
<xsp-request:remove-attribute name="attr"/>
<h2>Links</h2>
<a href="request-test?param=value&a=b&x=y">Get</a>
<br/>
<form method="post" action="request-test">
<input name="param"/>
<input type="submit" value="Post"/>
</form>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/xsp-js/response.xsp
Index: response.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- CVS: $Id: response.xsp,v 1.1 2002/07/02 13:06:39 cziegeler Exp $ -->
<xsp:page language="javascript"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-response="http://apache.org/xsp/response/2.0">
<page>
<h1>xsp-response logicsheet output</h1>
<table border="1">
<tr>
<th>Logicsheet tag</th><th>Output</th><th>Java method</th><th>Output</th></tr>
<tr>
<td>get-character-encoding</td><td><xsp-response:get-character-encoding/></td>
<td>getCharacterEncoding</td><td><xsp:expr>response.getCharacterEncoding()</xsp:expr></td>
</tr>
<tr>
<td>get-locale</td><td><xsp-response:get-locale/></td>
<td>getLocale</td><td><xsp:expr>response.getLocale()</xsp:expr></td>
</tr>
<tr>
<td>set-locale to GERMANY</td><td>
<xsp-response:set-locale><xsp:expr>java.util.Locale.GERMANY</xsp:expr></xsp-response:set-locale>
</td>
</tr>
<tr>
<td>get-locale</td><td><xsp-response:get-locale/></td>
<td>getLocale</td><td><xsp:expr>response.getLocale()</xsp:expr></td>
</tr>
<xsp-response:set-locale><xsp:expr>java.util.Locale.getDefault()</xsp:expr></xsp-response:set-locale>
<tr>
<td>add-date-header</td><td>
<xsp-response:add-date-header name="X-Cocoon-Date">
<xsp-response:date><xsp:expr>new java.util.Date()</xsp:expr></xsp-response:date>
</xsp-response:add-date-header></td>
<td>addDateHeader</td><td><xsp:logic>response.addDateHeader("X-Java-Date", -1);</xsp:logic></td>
</tr>
<tr>
<td>add-header</td><td>
<xsp-response:add-header name="X-Cocoon-Header" value="Value!"/>
</td>
<td>addHeader</td><td><xsp:logic>response.addHeader("X-Java-Header", "Value!");</xsp:logic></td>
</tr>
<tr>
<td>add-int-header</td><td>
<xsp-response:add-int-header name="X-Cocoon-Int">
<xsp-response:value><xsp:expr>5</xsp:expr></xsp-response:value>
</xsp-response:add-int-header></td>
<td>addIntHeader</td><td><xsp:logic>response.addIntHeader("X-Java-Int", 5);</xsp:logic></td>
</tr>
<tr>
<td>contains-header</td><td>
<xsp-response:contains-header name="X-Cocoon-Header"/>
</td>
<td>containsHeader</td><td><xsp:expr>response.containsHeader("X-Java-Header")</xsp:expr></td>
</tr>
<tr>
<td>encode-url</td><td>
<xsp-response:encode-url url="http://localhost:8080/cocoon/welcome"/>
</td>
<td>encodeURL</td><td><xsp:expr>response.encodeURL("http://localhost:8080/cocoon/welcome")</xsp:expr></td>
</tr>
<!--
xsp-response:add-cookie
xsp-response:set-date-header
xsp-response:set-header
xsp-response:set-int-header
-->
</table>
<h1>xsp-response logicsheet output (as xml)</h1>
<textarea cols="100" rows="12">
get-character-encoding <xsp-response:get-character-encoding as="xml"/>
get-locale <xsp-response:get-locale as="xml"/>
contains-header <xsp-response:contains-header name="X-Cocoon-Header" as="xml"/>
encode-url <xsp-response:encode-url url="http://localhost:8080/cocoon/welcome" as="xml"/>
</textarea>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/xsp-js/session.xsp
Index: session.xsp
===================================================================
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- CVS: $Id: session.xsp,v 1.1 2002/07/02 13:06:39 cziegeler Exp $ -->
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-session="http://apache.org/xsp/session/2.0"
create-session="yes">
<page>
<p>Adding attribute attr1='Test Value!'.</p>
<xsp-session:set-attribute name="attr1">Test value!</xsp-session:set-attribute>
<p>Set max inactive interval to 500</p>
<xsp-session:set-max-inactive-interval interval="500"/>
<h1>xsp-session logicsheet output</h1>
<table border="1">
<tr>
<th>Logicsheet tag</th><th>Output</th></tr>
<tr>
<td>get-session-id</td><td><xsp-session:get-session-id/></td></tr>
<tr>
<td>get-attribute</td><td><xsp-session:get-attribute name="attr1"/></td></tr>
<tr>
<td>get-attribute-names</td><td><xsp:expr><xsp-session:get-attribute-names as="array"/></xsp:expr></td></tr>
<tr>
<td>get-creation-time</td><td><xsp-session:get-creation-time/></td></tr>
<tr>
<td>get-creation-time (string)</td><td><xsp-session:get-creation-time as="string"/></td></tr>
<tr>
<td>get-id</td><td><xsp-session:get-id/></td></tr>
<tr>
<td>get-last-accessed-time</td><td><xsp-session:get-last-accessed-time/></td></tr>
<tr>
<td>get-last-accessed-time (string)</td><td><xsp-session:get-last-accessed-time as="string"/></td></tr>
<tr>
<td>get-max-inactive-interval</td><td><xsp-session:get-max-inactive-interval/></td></tr>
<tr>
<td>is-new</td><td><xsp-session:is-new/></td></tr>
</table>
<h1>xsp-session logicsheet output (as xml)</h1>
<textarea cols="100" rows="20">
get-session-id <xsp-session:get-session-id as="xml"/>
get-attribute <xsp-session:get-attribute name="attr1" as="xml"/>
get-attribute-names <xsp-session:get-attribute-names as="xml"/>
get-creation-time <xsp-session:get-creation-time as="xml"/>
get-id <xsp-session:get-id as="xml"/>
get-last-accessed-time <xsp-session:get-last-accessed-time as="xml"/>
get-max-inactive-interval <xsp-session:get-max-inactive-interval as="xml"/>
is-new <xsp-session:is-new as="xml"/>
encode-url <xsp-session:encode-url href="../" as="xml"/>
form-encode-url <xsp-session:form-encode-url href="../"/>
</textarea>
<p>Removing attribute attr1</p>
<xsp-session:remove-attribute name="attr1"/>
<p>Invalidating session</p>
<xsp-session:invalidate/>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/xsp-js/simple.xsp
Index: simple.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- CVS: $Id: simple.xsp,v 1.1 2002/07/02 13:06:39 cziegeler Exp $ -->
<xsp:page language="javascript" xmlns:xsp="http://apache.org/xsp">
<page>
<title>A Simple XSP Page in Javascript</title>
<content>
<para>Hi there! I'm a simple dynamic page generated by XSP (eXtensible Server Pages).</para>
<para>
Testing Javascript:
<ul>
<li>
<xsp:logic>
i = 1;
<xsp:content>Integer in Javascript: <xsp:expr>i</xsp:expr>
</xsp:content>
</xsp:logic>
</li>
<li>
<xsp:logic>
s = "Test Javascript String";
<xsp:content>String in Javascript: <xsp:expr>s</xsp:expr>
</xsp:content>
</xsp:logic>
</li>
<li>
Java 'page' object: <xsp:expr>page</xsp:expr>
</li>
<li>
Java 'request' object: <xsp:expr>request</xsp:expr>
</li>
<li>
Request locale object: <xsp:expr>request.getLocale()</xsp:expr>
</li>
<li>
Java Null object: <xsp:expr>request.getUserPrincipal()</xsp:expr>
</li>
</ul>
</para>
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/docs/samples/xsp-py/hello.xsp
Index: hello.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page language="python" xmlns:xsp="http://apache.org/xsp">
<page>
<title>Hello from XSP page in Python</title>
<para>
<b>This</b> is my first <b>Cocoon</b> page!
</para>
<xsp:element>
<xsp:param name="name">para</xsp:param>
With the help of XSP and Python!
</xsp:element>
<para>
<xsp:logic>
align = "center";
<p>
<xsp:attribute name="align"><xsp:expr>align</xsp:expr></xsp:attribute>
<xsp:logic>
msg = "Executed at: "
import time
now = time.asctime(time.localtime())
<xsp:content>
Executed at:
<xsp:expr>now</xsp:expr>
</xsp:content>
</xsp:logic>
</p>
</xsp:logic>
</para>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/logicsheets/hello.xsl
Index: hello.xsl
===================================================================
<?xml version="1.0"?>
<!--
*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* _________________________________________________________________________ *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************
-->
<!--
* Hello World logicsheet for the Java language
*
* @author <a href="mailto:vgritsenko@apache.org>Vadim Gritsenko</a>
* @version CVS $Revision: 1.1 $ $Date: 2002/07/02 13:06:40 $
-->
<xsl:stylesheet
version="1.0"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-hello="http://apache.org/xsp/hello/1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="xsp-hello:greeting">
<xsl:variable name="name">
<xsl:choose>
<xsl:when test="@name">"<xsl:value-of select="@name"/>"</xsl:when>
<xsl:when test="xsp-hello:name">
<xsl:call-template name="get-nested-content">
<xsl:with-param name="content" select="xsp-hello:name"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:variable name="value">
<xsl:choose>
<xsl:when test="@value">"<xsl:value-of select="@value"/>"</xsl:when>
<xsl:when test="xsp-hello:value">
<xsl:call-template name="get-nested-content">
<xsl:with-param name="content" select="xsp-hello:value"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>"Hello"</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsp:content>
<xsp:expr><xsl:value-of select="$value"/></xsp:expr>,
<xsp:expr><xsl:value-of select="$name"/></xsp:expr>!
</xsp:content>
</xsl:template>
<xsl:template name="get-nested-content">
<xsl:param name="content"/>
<xsl:choose>
<xsl:when test="$content/*">
<xsl:apply-templates select="$content/*"/>
</xsl:when>
<xsl:otherwise>"<xsl:value-of select="$content"/>"</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="@*|*|text()|processing-instruction()">
<xsl:copy>
<xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/myapp/readme.html
Index: readme.html
===================================================================
<!-- CVS: $Id: readme.html,v 1.1 2002/07/02 13:06:40 cziegeler Exp $ -->
<html>
<head>
<title>Minimal Cocoon Web Application - README</title>
</head>
<body>
<pre>
==================================================================
Minimal Cocoon Web Application Template
by Konstantin Piroumian (kpiroumian@apache.org)
Date: $Date: 2002/07/02 13:06:40 $
==================================================================
This is the place where you can start hacking with Cocoon.
What you have to know before using this template
------------------------------------------------
1. You should know basics of XML: how to create content
2. You should be familiar more or less with XSLT
3. You should be familiar with Web Applications
and servlet environment
4. It's not neccessary, but it'd be fine if you were familiar
with Java language, so you could create dynamic pages
For newbies
------------
1. Create XML files, drop them into 'xml' directory
2. Edit the stylesheet named style.xsl to render your xml,
just drop it into 'xsl' directory
3. Access this URL: http://localhost:port/cocoon/myapp/page.xml
where
'page' is actual name of your xml file, say 'index.xml'
'port' your app server port where it handles servlet requests,
8080 for Tomcat
4. Enjoy!
Note: Templates for XML, XSLT files are provided for your convenience.
A little more advanced users
----------------------------
1. Create XSP files, drop them into 'xml' directory
2. Create/reuse stylesheet(s) to render your XSP output
3. Access this URL: http://localhost:port/cocoon/myapp/page.xsp
4. Fix your XSP, try again
5. Enjoy!
Very advanced users
--------------------
1. Read User docs (http://xml.apache.org/cocoon/userdocs/)
2. Edit your sitemap.xmap as needed for your application:
- add/use components (see root sitemap to see what is availble)
- add/modify pipelines (change matching patterns, add actions)
- use more transformations in pipeline
- use aggregation
- create sitemap resources
- create sitemap views
Not all the above is necessary for every application.
For advanced developers
------------------------
You don't need this application, you can create your own, if no,
then look a few lines upper ;)
1. Read Developer docs (http://xml.apache.org/cocoon/developing/extending.html)
2. Implement your own components:
- actions
- generators
- transformers
- serializers
- sources
- [add your own]
Note: You can find a lot of samples to learn from in Cocoon sources.
3. Declare your components in sitemap
4. Debug your sitemap
5. Debug your components
6. Enjoy when it works!
For all kind of users
---------------------
- Join Cocoon Users mail list and ask questions if you don't find the answer in FAQ or docs
- Join Cocoon Dev mail list to participate in Cocoon development
That's all folks!
Cocoon Team wishes you Happy Hacking with Cocoon 2.1!
</pre>
</body>
</html>
1.1 xml-cocoon2/src/webapp/samples/myapp/sitemap.xmap
Index: sitemap.xmap
===================================================================
<?xml version="1.0"?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<!-- CVS: $Id: sitemap.xmap,v 1.1 2002/07/02 13:06:40 cziegeler Exp $ -->
<!--
Minimal sitemap to start making XML/XSP/XSLT transformations.
Author: Konstantin Piroumian "kpiroumian@apache.org"
-->
<map:components>
<map:generators default="file"/>
<map:transformers default="xslt"/>
<map:readers default="resource"/>
<map:serializers default="html"/>
<map:matchers default="wildcard"/>
<map:selectors default="browser"/>
</map:components>
<!-- =========================== Pipelines ================================= -->
<map:pipelines>
<map:pipeline>
<!-- Default URL matcher. Matches '/' URLs-->
<map:match pattern="">
<map:redirect-to uri="readme.html" />
</map:match>
<!-- This matches requests like 'page.xml' to display static output -->
<map:match pattern="*.xml">
<!-- {1} contains the value that substituted '*' in the pattern-->
<map:generate src="xml/{1}.xml"/>
<!-- You can change 'src' to 'xsl/{1}.xsl' to use custom stylesheets
for every page, e.g.: mypage.xml -> mypage.xsl -->
<map:transform src="xsl/style.xsl"/>
<!-- Just output the result as HTML (default)
Add 'type' attribute with 'xml' value to get XML output
-->
<map:serialize/>
</map:match>
<!-- This matches requests like 'page.xsp' to display dynamic output -->
<map:match pattern="*.xsp">
<!-- This generator uses 'serverpages' generator.
See the root sitemap for other types of available components -->
<map:generate type="serverpages" src="xsp/{1}.xsp"/>
<map:transform src="xsl/style.xsl"/>
<map:serialize/>
</map:match>
<!-- Display static HTML files, like readme.html -->
<map:match pattern="*.html">
<map:read src="{1}.html" mime-type="text/html" />
</map:match>
<!-- Add your pipelines here -->
</map:pipeline>
</map:pipelines>
</map:sitemap>
<!-- end of file -->
1.1 xml-cocoon2/src/webapp/samples/myapp/xml/page.xml
Index: page.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!-- CVS: $Id: page.xml,v 1.1 2002/07/02 13:06:40 cziegeler Exp $ -->
<page>
<title>My App page</title>
<content>
<para>Just a static contents</para>
</content>
</page>
1.1 xml-cocoon2/src/webapp/samples/myapp/xsl/style.xsl
Index: style.xsl
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!-- CVS: $Id: style.xsl,v 1.1 2002/07/02 13:06:40 cziegeler Exp $ -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="page">
<html>
<head>
<title><xsl:value-of select="title" /></title>
</head>
<body>
<xsl:apply-templates />
</body>
</html>
</xsl:template>
<xsl:template match="title">
<h1><xsl:value-of select="." /></h1>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/myapp/xsp/page.xsp
Index: page.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- CVS: $Id: page.xsp,v 1.1 2002/07/02 13:06:40 cziegeler Exp $ -->
<!--
XSP can be assotiated with the logicsheet using processing
instruction xml-logicsheet or the xsp:logicsheet element.
Do not use both methods!
<?xml-logicsheet href="logicsheets/hello.xsl"?>
-->
<xsp:page language="java" xmlns:xsp="http://apache.org/xsp">
<!-- Place your imports here. Note, that you shoud have imported
packages somewhere in classpath. -->
<xsp:structure>
<xsp:include>java.util.Date</xsp:include>
</xsp:structure>
<!-- Place your class level logic here -->
<xsp:logic>
private Date getDate() {
return new Date();
}
</xsp:logic>
<!-- Your content root element -->
<page>
<!-- Place logicsheet declarations here. Href is relative to app context -->
<!--
<xsp:logicsheet location="logicsheets/hello.xsl"/>
-->
<title>My App XSP Page</title>
<content>
<para>
Some dynamic content <xsp:expr>getDate()</xsp:expr>
</para>
</content>
</page>
</xsp:page>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/deli_test.xsl
Index: deli_test.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:param name="deli-capabilities"/>
<xsl:param name="accept"/>
<xsl:template match="/">
<xsl:if test="normalize-space($accept)=''">
<html>
<head>
<title>Test Page for DELI in Cocoon</title>
</head>
<body>
<h1>DELI is switched off</h1>
</body>
</html>
</xsl:if>
<xsl:if test="contains($accept,'wml') and not(normalize-space($accept)='')">
<xsl:call-template name="wmldevice"/>
</xsl:if>
<xsl:if test="not(contains($accept,'wml')) and not(normalize-space($accept)='')">
<xsl:call-template name="htmldevice"/>
</xsl:if>
</xsl:template>
<xsl:template name="wmldevice">
<wml>
<card id="init" newcontext="true">
<p>
<xsl:call-template name="capabilities"/>
</p>
</card>
</wml>
</xsl:template>
<xsl:template name="htmldevice">
<html>
<head>
<title>Test Page for DELI in Cocoon</title>
</head>
<body>
<xsl:call-template name="capabilities"/>
</body>
</html>
</xsl:template>
<xsl:template name="capabilities">
<xsl:if test="$deli-capabilities/browser/ColorCapable">
ColorCapable: <xsl:value-of select="$deli-capabilities/browser/ColorCapable"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/AudioInputEncoder">
AudioInputEncoder: <xsl:for-each select="$deli-capabilities/browser/AudioInputEncoder/li">
<xsl:value-of select="."/>,
</xsl:for-each>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/DownloadableBrowserApps">
DownloadableBrowserApps: <xsl:for-each select="$deli-capabilities/browser/DownloadableBrowserApps/li">
<xsl:value-of select="."/>,
</xsl:for-each>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/TextInputCapable">
TextInputCapable: <xsl:value-of select="$deli-capabilities/browser/TextInputCapable"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/ImageCapable">
ImageCapable: <xsl:value-of select="$deli-capabilities/browser/ImageCapable"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/CcppAccept">
CcppAccept:
<xsl:for-each select="$deli-capabilities/browser/CcppAccept/li">
<xsl:value-of select="."/>,
</xsl:for-each>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/CcppAccept-Charset">
CcppAccept-Charset: <xsl:for-each select="$deli-capabilities/browser/CcppAccept-Charset/li">
<xsl:value-of select="."/>,
</xsl:for-each>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/CcppAccept-Encoding">
CcppAccept-Encoding: <xsl:for-each select="$deli-capabilities/browser/CcppAccept-Encoding/li">
<xsl:value-of select="."/>,
</xsl:for-each>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/CcppAccept-Language">
CcppAccept-Language: <xsl:for-each select="$deli-capabilities/browser/CcppAccept-Language/li">
<xsl:value-of select="."/>,
</xsl:for-each>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/JavaPlatform">
JavaPlatform: <xsl:for-each select="$deli-capabilities/browser/JavaPlatform/li">
<xsl:value-of select="."/>,
</xsl:for-each>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/JVMVersion">
JVMVersion: <xsl:for-each select="$deli-capabilities/browser/JVMVersion/li">
<xsl:value-of select="."/>,
</xsl:for-each>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/XhtmlModules">
XhtmlModules: <xsl:for-each select="$deli-capabilities/browser/XhtmlVersion/li">
<xsl:value-of select="."/>,
</xsl:for-each>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/SupportedPictogramSet">
SupportedPictogramSet: <xsl:for-each select="$deli-capabilities/browser/SupportedPictogramSet/li">
<xsl:value-of select="."/>,
</xsl:for-each>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/OutputCharSet">
OutputCharSet: <xsl:for-each select="$deli-capabilities/browser/OutputCharSet/li">
<xsl:value-of select="."/>,
</xsl:for-each>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/InputCharSet">
InputCharSet: <xsl:for-each select="$deli-capabilities/browser/InputCharSet/li">
<xsl:value-of select="."/>,
</xsl:for-each>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/WmlScriptVersion">
WmlScriptVersion: <xsl:for-each select="$deli-capabilities/browser/WmlScriptVersion/li">
<xsl:value-of select="."/>,
</xsl:for-each>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/WmlVersion">
WmlVersion: <xsl:for-each select="$deli-capabilities/browser/WmlVersion/li">
<xsl:value-of select="."/>,
</xsl:for-each>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/VideoInputEncoder">
VideoInputEncoder: <xsl:for-each select="$deli-capabilities/browser/VideoInputEncoder/li">
<xsl:value-of select="."/>,
</xsl:for-each>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/SupportedBeareres">
SupportedBearers: <xsl:for-each select="$deli-capabilities/browser/SupportedBearers/li">
<xsl:value-of select="."/>,
</xsl:for-each>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/SecuritySupport">
SecuritySupport: <xsl:value-of select="$deli-capabilities/browser/SecuritySupport"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/CurrentBearerService">
CurrentBearerService: <xsl:value-of select="$deli-capabilities/browser/CurrentBearerService"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/BrowserName">
BrowserName: <xsl:value-of select="$deli-capabilities/browser/BrowserName"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/BrowserVersion">
BrowserVersion: <xsl:value-of select="$deli-capabilities/browser/BrowserVersion"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/SupportedBlueToothVersion">
SupportedBluetoothVersion: <xsl:value-of select="$deli-capabilities/browser/SupportedBlueToothVersion"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/SoftwareNumber">
SoftwareNumber: <xsl:value-of select="$deli-capabilities/browser/SoftwareNumber"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/HtmlVersion">
HtmlVersion: <xsl:value-of select="$deli-capabilities/browser/HtmlVersion"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/JavaAppletEnabled">
JavaAppletEnabled: <xsl:value-of select="$deli-capabilities/browser/JavaAppletEnabled"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/JavaScriptEnabled">
JavaScriptEnabled: <xsl:value-of select="$deli-capabilities/browser/JavaScriptEnabled"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/JavaScriptVersion">
JavaScriptVersion: <xsl:value-of select="$deli-capabilities/browser/JavaScriptVersion"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/PreferenceForFrames">
PreferenceForFrames: <xsl:value-of select="$deli-capabilities/browser/PreferenceForFrames"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/TablesCapable">
TablesCapable: <xsl:value-of select="$deli-capabilities/browser/TablesCapable"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/XhtmlVersion">
XhtmlVersion: <xsl:value-of select="$deli-capabilities/browser/XhtmlVersion"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/WapDeviceClass">
WapDeviceClass: <xsl:value-of select="$deli-capabilities/browser/WapDeviceClass"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/WapVersion">
WapVersion: <xsl:value-of select="$deli-capabilities/browser/WapVersion"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/WmlDeckSize">
WmlDeckSize: <xsl:value-of select="$deli-capabilities/browser/WmlDeckSize"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/WmlScriptLibraries">
WmlScriptLibraries: <xsl:for-each select="$deli-capabilities/browser/WmlScriptLibraries/li">
<xsl:value-of select="."/>,
</xsl:for-each>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/WtaiLibraries">
WtaiLibraries: <xsl:for-each select="$deli-capabilities/browser/WtaiLibraries/li">
<xsl:value-of select="."/>,
</xsl:for-each>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/WtaiVersion">
WtaiVersion: <xsl:value-of select="$deli-capabilities/browser/WtaiVersion"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/BluetoothProfile">
BluetoothProfile: <xsl:for-each select="$deli-capabilities/browser/BluetoothProfile/li">
<xsl:value-of select="."/>,
</xsl:for-each>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/ImageCapable">
ImageCapable: <xsl:value-of select="$deli-capabilities/browser/ImageCapable"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/Keyboard">
Keyboard: <xsl:value-of select="$deli-capabilities/browser/Keyboard"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/CPU">
CPU: <xsl:value-of select="$deli-capabilities/browser/CPU"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/Model">
Model: <xsl:value-of select="$deli-capabilities/browser/Model"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/NumberOfSoftKeys">
NumberOfSoftKeys: <xsl:value-of select="$deli-capabilities/browser/NumberOfSoftKeys"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/PixelAspectRatio">
PixelAspectRatio: <xsl:value-of select="$deli-capabilities/browser/PixelAspectRatio"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/PointingResolution">
PointingResolution: <xsl:value-of select="$deli-capabilities/browser/PointingResolution"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/ScreenSize">
ScreenSize: <xsl:value-of select="$deli-capabilities/browser/ScreenSize"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/ScreenSizeChar">
ScreenSizeChar: <xsl:value-of select="$deli-capabilities/browser/ScreenSizeChar"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/StandardFontProportional">
StandardFontProportional: <xsl:value-of select="$deli-capabilities/browser/StandardFontProportional"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/SoundOutputCapable">
SoundOutputCapable: <xsl:value-of select="$deli-capabilities/browser/SoundOutputCapable"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/TextInputCapable">
TextInputCapable: <xsl:value-of select="$deli-capabilities/browser/TextInputCapable"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/RecipientAppAgent">
RecipientAppAgent: <xsl:value-of select="$deli-capabilities/browser/RecipientAppAgent"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/OSVersion">
OSVersion: <xsl:value-of select="$deli-capabilities/browser/OSVersion"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/MexeSpec">
MexeSpec: <xsl:value-of select="$deli-capabilities/browser/MexeSpec"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/MexeClassmarks">
MexeClassmarks: <xsl:for-each select="$deli-capabilities/browser/MexeClassmarks/li">
<xsl:value-of select="."/>,
</xsl:for-each>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/JavaEnabled">
JavaEnabled: <xsl:value-of select="$deli-capabilities/browser/JavaEnabled"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/DownloadableSoftwareSupport">
DownloadableSoftwareSupport: <xsl:for-each select="$deli-capabilities/browser/DownloadableSoftwareSupport/li">
<xsl:value-of select="."/>,
</xsl:for-each>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/AcceptDownloadableSoftware">
AcceptDownloadableSoftware: <xsl:value-of select="$deli-capabilities/browser/AcceptDownloadableSoftware"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/VoiceInputCapable">
VoiceInputCapable: <xsl:value-of select="$deli-capabilities/browser/VoiceInputCapable"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/Vendor">
Vendor: <xsl:value-of select="$deli-capabilities/browser/Vendor"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/FramesCapable">
FramesCapable: <xsl:value-of select="$deli-capabilities/browser/FramesCapable"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/BitsPerPixel">
BitsPerPixel: <xsl:value-of select="$deli-capabilities/browser/BitsPerPixel"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/Push-Accept">
Push-Accept: <xsl:for-each select="$deli-capabilities/browser/Push-Accept/li">
<xsl:value-of select="."/>,
</xsl:for-each>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/Push-Accept-Charset">
Push-Accept-Charset: <xsl:for-each select="$deli-capabilities/browser/Push-Accept-Charset/li">
<xsl:value-of select="."/>,
</xsl:for-each>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/Push-Accept-Encoding">
Push-Accept-Encoding: <xsl:for-each select="$deli-capabilities/browser/Push-Accept-Encoding/li">
<xsl:value-of select="."/>,
</xsl:for-each>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/Push-Accept-Language">
Push-Accept-Language: <xsl:for-each select="$deli-capabilities/browser/Push-Accept-Language/li">
<xsl:value-of select="."/>,
</xsl:for-each>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/Push-Accept-AppID">
Push-Accept-AppID: <xsl:for-each select="$deli-capabilities/browser/PushAccept-AppID/li">
<xsl:value-of select="."/>,
</xsl:for-each>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/Push-MsgSize">
Push-MsgSize: <xsl:value-of select="$deli-capabilities/browser/Push-MsgSize"/>
<br/>
</xsl:if>
<xsl:if test="$deli-capabilities/browser/Push-MaxPushReq">
Push-MaxPushReq: <xsl:value-of select="$deli-capabilities/browser/Push-MaxPushReq"/>
<br/>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/dynamic-page2html.xsl
Index: dynamic-page2html.xsl
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
xmlns:xsp="http://apache.org/xsp">
<xsl:include href="page/simple-page2html.xsl"/>
<xsl:template match="xsp-request:uri">
<b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="xsp-request:parameter">
<i><xsl:value-of select="@name"/></i>:<b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="xsp-request:parameter-values">
<p>Parameter Values for "<xsl:value-of select="@name"/>":</p>
<ul>
<xsl:for-each select="xsp-request:value">
<li>
<xsl:value-of select="."/>
</li>
</xsl:for-each>
</ul>
</xsl:template>
<xsl:template match="xsp-request:parameter-names">
<p>All Parameter Names:</p>
<ul>
<xsl:for-each select="xsp-request:name">
<li>
<xsl:value-of select="."/>
</li>
</xsl:for-each>
</ul>
</xsl:template>
<xsl:template match="xsp-request:headers">
<p>Headers:</p>
<ul>
<xsl:for-each select="xsp-request:header">
<li>
<i><xsl:value-of select="@name"/></i>:
<b><xsl:value-of select="."/></b>
</li>
</xsl:for-each>
</ul>
<br/>
</xsl:template>
<xsl:template match="xsp-request:header">
<i><xsl:value-of select="@name"/></i>:<b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="xsp-request:header-names">
<p>All Header names:</p>
<ul>
<xsl:for-each select="xsp-request:name">
<li>
<xsl:value-of select="."/>
</li>
</xsl:for-each>
</ul>
</xsl:template>
<xsl:template match="@*|node()" priority="-1">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/fragment-extractor.xsl
Index: fragment-extractor.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fe="http://apache.org/cocoon/fragmentextractor/2.0">
<xsl:template match="//fe:fragment">
<img src="welcome-svg-images/{@fragment-id}.png" border="0"/>
</xsl:template>
<xsl:template match="@*|*|text()|processing-instruction()" priority="-1">
<xsl:copy>
<xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/simple-samples2html.xsl
Index: simple-samples2html.xsl
===================================================================
<?xml version="1.0"?>
<!-- Author: Nicola Ken Barozzi "barozzi@nicolaken.com" -->
<!-- Author: Vadim Gritsenko "vgritsenko@apache.org" -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink">
<xsl:template match="/">
<html>
<head>
<title>Apache Cocoon @version@</title>
<link rel="SHORTCUT ICON" href="favicon.ico"/>
</head>
<body bgcolor="#ffffff" link="#0086b2" vlink="#00698c" alink="#743e75">
<table border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
<tr>
<td colspan="3" align="center"><font face="arial,helvetica,sanserif" color="#000000">The Apache Software Foundation is proud to present...</font></td>
</tr>
<tr>
<td width="30%"></td>
<td width="40%" align="center"><img border="0" src="images/cocoon.gif"/></td>
<td width="30%" align="center"><font face="arial,helvetica,sanserif" color="#000000"><b>version @version@</b></font></td>
</tr>
</table>
<xsl:apply-templates select="samples"/>
<p align="center">
<font size="-1">
Copyright © @year@ <a href="http://www.apache.org">The Apache Software Foundation</a>.<br/>
All rights reserved.
</font>
</p>
</body>
</html>
</xsl:template>
<xsl:template match="samples">
<xsl:variable name="all-samples" select="count(group/sample)"/>
<xsl:variable name="half-samples" select="round($all-samples div 2)"/>
<xsl:variable name="half-possibilities">
<xsl:for-each select="group">
<xsl:if test="position() < last() and position() > 1">
<xsl:variable name="group-position" select="position()"/>
<xsl:variable name="prev-sample" select="count(../group[position() <= $group-position - 1]/sample)"/>
<xsl:variable name="curr-sample" select="count(../group[position() <= $group-position]/sample)"/>
<xsl:variable name="next-sample" select="count(../group[position() <= $group-position + 1]/sample)"/>
<xsl:variable name="prev-deviation">
<xsl:choose>
<xsl:when test="$prev-sample > $half-samples">
<xsl:value-of select="$prev-sample - $half-samples"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$half-samples - $prev-sample"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="curr-deviation">
<xsl:choose>
<xsl:when test="$curr-sample > $half-samples">
<xsl:value-of select="$curr-sample - $half-samples"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$half-samples - $curr-sample"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="next-deviation">
<xsl:choose>
<xsl:when test="$next-sample > $half-samples">
<xsl:value-of select="$next-sample - $half-samples"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$half-samples - $next-sample"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$prev-deviation >= $curr-deviation and $curr-deviation <= $next-deviation">
<xsl:value-of select="$group-position"/><xsl:text> </xsl:text>
</xsl:if>
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:variable name="half">
<xsl:value-of select="substring-before($half-possibilities, ' ')"/>
</xsl:variable>
<table width="100%">
<tr>
<td width="50%" valign="top">
<xsl:for-each select="group">
<xsl:variable name="group-position" select="position()"/>
<xsl:choose>
<xsl:when test="$group-position <= $half">
<table border="0" bgcolor="#000000" cellpadding="0" cellspacing="0" width="97%">
<tbody>
<tr>
<td>
<table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
<tr>
<td bgcolor="#0086b2" width="100%" align="left">
<font size="+1" face="arial,helvetica,sanserif" color="#ffffff"><xsl:value-of select="@name"/></font>
</td>
</tr>
<tr>
<td width="100%" bgcolor="#ffffff" align="left">
<table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2" width="100%" align="center">
<xsl:apply-templates/>
</table>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<br/>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</td>
<td valign="top">
<xsl:for-each select="group"> <!-- [position()<=$half] -->
<xsl:variable name="group-position" select="position()"/>
<xsl:choose>
<xsl:when test="$group-position > $half">
<table border="0" bgcolor="#000000" cellpadding="0" cellspacing="0" width="97%">
<tbody>
<tr>
<td>
<table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
<tr>
<td bgcolor="#0086b2" width="100%" align="left">
<font size="+1" face="arial,helvetica,sanserif" color="#ffffff"><xsl:value-of select="@name"/></font>
</td>
</tr>
<tr>
<td width="100%" bgcolor="#ffffff" align="left">
<table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2" width="100%" align="center">
<xsl:apply-templates/>
</table>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<br/>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="sample">
<tr>
<td width="100%" bgcolor="#ffffff" align="left">
<font size="+0" face="arial,helvetica,sanserif" color="#000000">
<a href="{@href}"><xsl:value-of select="@name"/></a><xsl:text> - </xsl:text>
<xsl:value-of select="."/>
</font>
</td>
</tr>
</xsl:template>
<xsl:template match="note">
<tr>
<td width="100%" bgcolor="#ffffff" align="left">
<font size="+0" face="arial,helvetica,sanserif" color="#000000">
<xsl:value-of select="."/>
</font>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/simple-sql2html.xsl
Index: simple-sql2html.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sql="http://apache.org/cocoon/SQL/2.0">
<xsl:import href="page/simple-page2html.xsl"/>
<xsl:template match="sql:rowset">
<xsl:choose>
<xsl:when test="ancestor::sql:rowset">
<tr>
<td>
<table border="1">
<xsl:apply-templates/>
</table>
</td>
</tr>
</xsl:when>
<xsl:otherwise>
<table border="1">
<xsl:apply-templates/>
</table>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="sql:row">
<tr>
<xsl:apply-templates/>
</tr>
</xsl:template>
<xsl:template match="sql:name">
<td><xsl:value-of select="."/></td>
</xsl:template>
<xsl:template match="sql:id">
<!-- ignore -->
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/simple-xml2html.xsl
Index: simple-xml2html.xsl
===================================================================
<!--
|
| XSLT REC Compliant Version of IE5 Default Stylesheet
|
| Original version by Jonathan Marsh (jmarsh@microsoft.com)
| http://msdn.microsoft.com/xml/samples/defaultss/defaultss.xsl
|
| Conversion to XSLT 1.0 REC Syntax by Steve Muench (smuench@oracle.com)
|
+-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="no" method="html"/>
<xsl:template match="/">
<HTML>
<HEAD>
<SCRIPT>
<xsl:comment><![CDATA[
function f(e){
if (e.className=="ci") {
if (e.children(0).innerText.indexOf("\n")>0) fix(e,"cb");
}
if (e.className=="di") {
if (e.children(0).innerText.indexOf("\n")>0) fix(e,"db");
} e.id="";
}
function fix(e,cl){
e.className=cl;
e.style.display="block";
j=e.parentElement.children(0);
j.className="c";
k=j.children(0);
k.style.visibility="visible";
k.href="#";
}
function ch(e) {
mark=e.children(0).children(0);
if (mark.innerText=="+") {
mark.innerText="-";
for (var i=1;i<e.children.length;i++) {
e.children(i).style.display="block";
}
}
else if (mark.innerText=="-") {
mark.innerText="+";
for (var i=1;i<e.children.length;i++) {
e.children(i).style.display="none";
}
}
}
function ch2(e) {
mark=e.children(0).children(0);
contents=e.children(1);
if (mark.innerText=="+") {
mark.innerText="-";
if (contents.className=="db"||contents.className=="cb") {
contents.style.display="block";
}
else {
contents.style.display="inline";
}
}
else if (mark.innerText=="-") {
mark.innerText="+";
contents.style.display="none";
}
}
function cl() {
e=window.event.srcElement;
if (e.className!="c") {
e=e.parentElement;
if (e.className!="c") {
return;
}
}
e=e.parentElement;
if (e.className=="e") {
ch(e);
}
if (e.className=="k") {
ch2(e);
}
}
function ex(){}
function h(){window.status=" ";}
document.onclick=cl;
]]>
</xsl:comment>
</SCRIPT>
<STYLE>
BODY {font:x-small 'Verdana'; margin-right:1.5em}
.c {cursor:hand}
.b {color:red; font-family:'Courier New'; font-weight:bold;
text-decoration:none}
.e {margin-left:1em; text-indent:-1em; margin-right:1em}
.k {margin-left:1em; text-indent:-1em; margin-right:1em}
.t {color:#990000}
.xt {color:#990099}
.ns {color:red}
.dt {color:green}
.m {color:blue}
.tx {font-weight:bold}
.db {text-indent:0px; margin-left:1em; margin-top:0px;
margin-bottom:0px;padding-left:.3em;
border-left:1px solid #CCCCCC; font:small Courier}
.di {font:small Courier}
.d {color:blue}
.pi {color:blue}
.cb {text-indent:0px; margin-left:1em; margin-top:0px;
margin-bottom:0px;padding-left:.3em; font:small Courier;
color:#888888}
.ci {font:small Courier; color:#888888}
PRE {margin:0px; display:inline}
</STYLE>
</HEAD>
<BODY class="st">
<xsl:apply-templates/>
</BODY>
</HTML>
</xsl:template>
<xsl:template match="processing-instruction()">
<DIV class="e">
<SPAN class="b">
<xsl:call-template name="nbsp-ref"/>
</SPAN>
<SPAN class="m">
<xsl:text><?</xsl:text>
</SPAN>
<SPAN class="pi">
<xsl:value-of select="name(.)"/>
<xsl:value-of select="."/>
</SPAN>
<SPAN class="m">
<xsl:text>?></xsl:text>
</SPAN>
</DIV>
</xsl:template>
<xsl:template match="processing-instruction('xml')">
<DIV class="e">
<SPAN class="b">
<xsl:call-template name="nbsp-ref"/>
</SPAN>
<SPAN class="m">
<xsl:text><?</xsl:text>
</SPAN>
<SPAN class="pi">
<xsl:text>xml </xsl:text>
<xsl:for-each select="@*">
<xsl:value-of select="name(.)"/>
<xsl:text>="</xsl:text>
<xsl:value-of select="."/>
<xsl:text>" </xsl:text>
</xsl:for-each>
</SPAN>
<SPAN class="m">
<xsl:text>?></xsl:text>
</SPAN>
</DIV>
</xsl:template>
<xsl:template match="@*">
<SPAN>
<xsl:attribute name="class">
<xsl:if test="xsl:*/@*">
<xsl:text>x</xsl:text>
</xsl:if>
<xsl:text>t</xsl:text>
</xsl:attribute>
<xsl:value-of select="name(.)"/>
</SPAN>
<SPAN class="m">="</SPAN>
<B>
<xsl:value-of select="."/>
</B>
<SPAN class="m">"</SPAN>
<xsl:if test="position()!=last()">
<xsl:text> </xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="text()">
<DIV class="e">
<SPAN class="b"> </SPAN>
<SPAN class="tx">
<xsl:value-of select="."/>
</SPAN>
</DIV>
</xsl:template>
<xsl:template match="comment()">
<DIV class="k">
<SPAN>
<A STYLE="visibility:hidden" class="b" onclick="return false" onfocus="h()">-</A>
<SPAN class="m">
<xsl:text><!--</xsl:text>
</SPAN>
</SPAN>
<SPAN class="ci" id="clean">
<PRE>
<xsl:value-of select="."/>
</PRE>
</SPAN>
<SPAN class="b">
<xsl:call-template name="nbsp-ref"/>
</SPAN>
<SPAN class="m">
<xsl:text>--></xsl:text>
</SPAN>
<SCRIPT>f(clean);</SCRIPT>
</DIV>
</xsl:template>
<xsl:template match="*">
<DIV class="e">
<DIV STYLE="margin-left:1em;text-indent:-2em">
<SPAN class="b">
<xsl:call-template name="nbsp-ref"/>
</SPAN>
<SPAN class="m"><</SPAN>
<SPAN>
<xsl:attribute name="class">
<xsl:if test="xsl:*">
<xsl:text>x</xsl:text>
</xsl:if>
<xsl:text>t</xsl:text>
</xsl:attribute>
<xsl:value-of select="name(.)"/>
<xsl:if test="@*">
<xsl:text> </xsl:text>
</xsl:if>
</SPAN>
<xsl:apply-templates select="@*"/>
<SPAN class="m">
<xsl:text>/></xsl:text>
</SPAN>
</DIV>
</DIV>
</xsl:template>
<xsl:template match="*[node()]">
<DIV class="e">
<DIV class="c">
<A class="b" href="#" onclick="return false" onfocus="h()">-</A>
<SPAN class="m"><</SPAN>
<SPAN>
<xsl:attribute name="class">
<xsl:if test="xsl:*">
<xsl:text>x</xsl:text>
</xsl:if>
<xsl:text>t</xsl:text>
</xsl:attribute>
<xsl:value-of select="name(.)"/>
<xsl:if test="@*">
<xsl:text> </xsl:text>
</xsl:if>
</SPAN>
<xsl:apply-templates select="@*"/>
<SPAN class="m">
<xsl:text>></xsl:text>
</SPAN>
</DIV>
<DIV>
<xsl:apply-templates/>
<DIV>
<SPAN class="b">
<xsl:call-template name="nbsp-ref"/>
</SPAN>
<SPAN class="m">
<xsl:text></</xsl:text>
</SPAN>
<SPAN>
<xsl:attribute name="class">
<xsl:if test="xsl:*">
<xsl:text>x</xsl:text>
</xsl:if>
<xsl:text>t</xsl:text>
</xsl:attribute>
<xsl:value-of select="name(.)"/>
</SPAN>
<SPAN class="m">
<xsl:text>></xsl:text>
</SPAN>
</DIV>
</DIV>
</DIV>
</xsl:template>
<xsl:template match="*[text() and not (comment() or processing-instruction())]">
<DIV class="e">
<DIV STYLE="margin-left:1em;text-indent:-2em">
<SPAN class="b">
<xsl:call-template name="nbsp-ref"/>
</SPAN>
<SPAN class="m">
<xsl:text><</xsl:text>
</SPAN>
<SPAN>
<xsl:attribute name="class">
<xsl:if test="xsl:*">
<xsl:text>x</xsl:text>
</xsl:if>
<xsl:text>t</xsl:text>
</xsl:attribute>
<xsl:value-of select="name(.)"/>
<xsl:if test="@*">
<xsl:text> </xsl:text>
</xsl:if>
</SPAN>
<xsl:apply-templates select="@*"/>
<SPAN class="m">
<xsl:text>></xsl:text>
</SPAN>
<SPAN class="tx">
<xsl:value-of select="."/>
</SPAN>
<SPAN class="m"></</SPAN>
<SPAN>
<xsl:attribute name="class">
<xsl:if test="xsl:*">
<xsl:text>x</xsl:text>
</xsl:if>
<xsl:text>t</xsl:text>
</xsl:attribute>
<xsl:value-of select="name(.)"/>
</SPAN>
<SPAN class="m">
<xsl:text>></xsl:text>
</SPAN>
</DIV>
</DIV>
</xsl:template>
<xsl:template match="*[*]" priority="20">
<DIV class="e">
<DIV STYLE="margin-left:1em;text-indent:-2em" class="c">
<A class="b" href="#" onclick="return false" onfocus="h()">-</A>
<SPAN class="m"><</SPAN>
<SPAN>
<xsl:attribute name="class">
<xsl:if test="xsl:*">
<xsl:text>x</xsl:text>
</xsl:if>
<xsl:text>t</xsl:text>
</xsl:attribute>
<xsl:value-of select="name(.)"/>
<xsl:if test="@*">
<xsl:text> </xsl:text>
</xsl:if>
</SPAN>
<xsl:apply-templates select="@*"/>
<SPAN class="m">
<xsl:text>></xsl:text>
</SPAN>
</DIV>
<DIV>
<xsl:apply-templates/>
<DIV>
<SPAN class="b">
<xsl:call-template name="nbsp-ref"/>
</SPAN>
<SPAN class="m">
<xsl:text></</xsl:text>
</SPAN>
<SPAN>
<xsl:attribute name="class">
<xsl:if test="xsl:*">
<xsl:text>x</xsl:text>
</xsl:if>
<xsl:text>t</xsl:text>
</xsl:attribute>
<xsl:value-of select="name(.)"/>
</SPAN>
<SPAN class="m">
<xsl:text>></xsl:text>
</SPAN>
</DIV>
</DIV>
</DIV>
</xsl:template>
<xsl:template name="nbsp-ref">
<xsl:text> </xsl:text>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/svg-samples2html.xsl
Index: svg-samples2html.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink">
<xsl:template match="/">
<html>
<head>
<title>Apache Cocoon @version@</title>
</head>
<body bgcolor="#ffffff" link="#0086b2" vlink="#00698c" alink="#743e75">
<table border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
<tr>
<td colspan="3" align="center"><font face="arial,helvetica,sanserif" color="#000000">The Apache Software Foundation is proud to present...</font></td>
</tr>
<tr>
<td width="30%"></td>
<td width="40%" align="center"><img border="0" src="images/cocoon.gif"/></td>
<td width="30%" align="center"><font face="arial,helvetica,sanserif" color="#000000"><b>version @version@</b></font></td>
</tr>
</table>
<xsl:apply-templates/>
<p align="center">
<font size="-1">
Copyright © @year@ <a href="http://www.apache.org">The Apache Software Foundation</a>.<br/>
All rights reserved.
</font>
</p>
</body>
</html>
</xsl:template>
<xsl:template name="generate-group-heading">
<xsl:param name="position"/>
<svg:svg width="200" height="15" xmlns:svg="http://www.w3.org/2000/svg">
<xsl:choose>
<xsl:when test="$position = 'left'">
<svg:g style="stroke: black; stroke-width: 2px;">
<svg:line x1="5" y1="5" x2="8" y2="5"/>
<svg:line x1="5" y1="5" x2="5" y2="15"/>
</svg:g>
<svg:text x="10px" y="11px" style="font-family:sans; font-size:15px; fill: #0086b2; text-anchor:start;">
<xsl:value-of select="@name"/>
</svg:text>
</xsl:when>
<xsl:otherwise>
<svg:g style="stroke: black; stroke-width: 2px;">
<svg:line x1="195" y1="5" x2="192" y2="5"/>
<svg:line x1="195" y1="5" x2="195" y2="15"/>
</svg:g>
<svg:text x="190px" y="11px" style="font-family:sans; font-size:15px; fill: #0086b2; text-anchor:end;">
<xsl:value-of select="@name"/>
</svg:text>
</xsl:otherwise>
</xsl:choose>
</svg:svg>
</xsl:template>
<xsl:template name="generate-item">
<xsl:param name="position"/>
<svg:svg width="200" height="15" xmlns:svg="http://www.w3.org/2000/svg">
<xsl:choose>
<xsl:when test="$position = 'left'">
<svg:g style="stroke: black; stroke-width: 2px;">
<xsl:choose>
<xsl:when test="position() = last()">
<svg:line x1="5" y1="-1" x2="5" y2="5"/>
</xsl:when>
<xsl:otherwise>
<svg:line x1="5" y1="-1" x2="5" y2="15"/>
</xsl:otherwise>
</xsl:choose>
<svg:line x1="5" y1="5" x2="18" y2="5"/>
</svg:g>
<svg:text x="20px" y="11px" style="font-family:sans; font-size:15px; fill: black; text-anchor:start;">
<xsl:value-of select="@name"/>
</svg:text>
</xsl:when>
<xsl:otherwise>
<svg:g style="stroke: black; stroke-width: 2px;">
<xsl:choose>
<xsl:when test="position() = last()">
<svg:line x1="195" y1="-1" x2="195" y2="5"/>
</xsl:when>
<xsl:otherwise>
<svg:line x1="195" y1="-1" x2="195" y2="15"/>
</xsl:otherwise>
</xsl:choose>
<svg:line x1="195" y1="5" x2="182" y2="5"/>
</svg:g>
<svg:text x="180px" y="11px" style="font-family:sans; font-size:15px; fill: black; text-anchor:end;">
<xsl:value-of select="@name"/>
</svg:text>
</xsl:otherwise>
</xsl:choose>
</svg:svg>
</xsl:template>
<xsl:template name="generate-group">
<xsl:param name="position"/>
<tr>
<td>
<xsl:call-template name="generate-group-heading">
<xsl:with-param name="position" select="$position"/>
</xsl:call-template>
</td>
</tr>
<xsl:for-each select="sample">
<tr>
<td>
<a href="{@href}">
<xsl:call-template name="generate-item">
<xsl:with-param name="position" select="$position"/>
</xsl:call-template>
</a>
</td>
</tr>
</xsl:for-each>
</xsl:template>
<xsl:template match="samples">
<xsl:variable name="half" select="round(count(group) div 2)"/>
<table cellspacing="0" cellpadding="0" border="0" align="center">
<tr>
<td valign="top">
<table cellspacing="0" cellpadding="0" border="0">
<xsl:for-each select="group[position() <= $half]">
<xsl:call-template name="generate-group">
<xsl:with-param name="position">left</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</table>
</td>
<td valign="top">
<table cellspacing="0" cellpadding="0" border="0">
<xsl:for-each select="group[position() > $half]">
<xsl:call-template name="generate-group">
<xsl:with-param name="position">right</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</table>
</td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/documents/book2sidebar.xsl
Index: book2sidebar.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<!-- match the root book element -->
<xsl:template match="/book">
<sidebar>
<xsl:apply-templates/>
</sidebar>
</xsl:template>
<xsl:template match="/book/external">
<link>
<xsl:copy-of select="@href|@label"/>
</link>
</xsl:template>
<xsl:template match="/book/page | /book/faq | /book/changes | /book/todo">
<link href="{substring(@source,1,string-length(@source)-4)}">
<xsl:copy-of select="@label|@id"/>
</link>
</xsl:template>
<xsl:template match="/book/separator">
<xsl:copy/>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/documents/root2html.xsl
Index: root2html.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
>
<xsl:param name="path"/>
<xsl:template match="/root">
<html>
<head>
<title><xsl:value-of select="document/header/title"/></title>
</head>
<body>
<table cellpadding="0" cellspacing="3">
<tr>
<td valign="top">
<xsl:apply-templates select="sidebar"/>
</td>
<td width="10"> </td>
<td valign="top">
<xsl:apply-templates select="document/body"/>
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="/root/sidebar">
<table cellpadding="1" cellspacing="2" bgcolor="#000000">
<tr bgcolor="#0086b2"><td>
<table cellpadding="1" cellspacing="0">
<xsl:apply-templates/>
</table>
</td></tr>
</table>
</xsl:template>
<xsl:template match="sidebar/link">
<tr>
<td>
<xsl:choose>
<xsl:when test="@href=$path">
<font color="#FFFFFF"><xsl:value-of select="@label"/></font>
</xsl:when>
<xsl:otherwise>
<a>
<xsl:copy-of select="@href"/>
<font color="#FFFFFF"><xsl:value-of select="@label"/></font>
</a>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:template>
<xsl:template match="sidebar/separator">
<tr><td height="10"></td></tr>
</xsl:template>
<xsl:template match="/root/document/body">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="body//s1">
<h1><xsl:value-of select="@title"/></h1>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="body//s2">
<h2><xsl:value-of select="@title"/></h2>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="body//s3">
<h3><xsl:value-of select="@title"/></h3>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="body//s4">
<h4><xsl:value-of select="@title"/></h4>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="body//link">
<a>
<xsl:copy-of select="@href"/>
<xsl:apply-templates/>
</a>
</xsl:template>
<xsl:template match="source">
<listing style="color: green; font-size: 80%;">
<xsl:apply-templates />
</listing>
</xsl:template>
<xsl:template match="body//node()|body//@*" priority="-1">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="body//figure">
<xsl:element name="img">
<xsl:for-each select="@*">
<xsl:attribute name="{name(.)}">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:for-each>
</xsl:element>
</xsl:template>
<xsl:template match="link">
<a href="{@href}"><xsl:apply-templates/></a>
</xsl:template>
<xsl:template match="connect">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="jump">
<a href="{@href}#{@anchor}"><xsl:apply-templates/></a>
</xsl:template>
<xsl:template match="fork">
<a href="{@href}" target="_blank"><xsl:apply-templates/></a>
</xsl:template>
<xsl:template match="anchor">
<a name="{@id}"><xsl:comment>anchor</xsl:comment></a>
</xsl:template>
<xsl:template match="tr[position() mod 2 = 0]">
<tr bgcolor="#B8EEFF">
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</tr>
</xsl:template>
<xsl:template match="th">
<th bgcolor="#0086B2">
<xsl:copy-of select="@*"/>
<font color="#FFFFFF"><xsl:apply-templates/></font>
</th>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/news/moreover.xsl
Index: moreover.xsl
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
[XSL-XSLT] This stylesheet automatically updated from an IE5-compatible XSL stylesheet to XSLT.
The following problems which need manual attention may exist in this stylesheet:
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- [XSL-XSLT] Simulate lack of built-in templates -->
<xsl:template match="@*|/|node()"/>
<!-- Match The Root Node -->
<xsl:template match="/">
<HTML>
<BODY>
<xsl:apply-templates select="*"></xsl:apply-templates>
</BODY>
</HTML>
</xsl:template>
<!-- Match Everything Else -->
<xsl:template match="*|@*|text()|node()|comment()|processing-instruction()">
<xsl:copy>
<xsl:apply-templates select="*|@*|text()|node()|comment()|processing-instruction()"></xsl:apply-templates>
</xsl:copy>
</xsl:template>
<!-- Individual Templates -->
<xsl:template match="moreovernews">
<table border="0" width="100%">
<tr>
<td colspan="3" STYLE="background-color : #B0E0E6; font : x-small Arial, Helvetica, sans-serif;">
<CENTER>
<b>Current News from moreover.com</b>
</CENTER>
</td>
</tr>
<xsl:apply-templates select="article"></xsl:apply-templates>
</table>
</xsl:template>
<xsl:template match="article">
<tr>
<xsl:if test="(position() mod 2) = 1">
<xsl:attribute name="STYLE">background-color : lightgrey; font : x-small Arial, Helvetica, sans-serif;</xsl:attribute>
</xsl:if>
<xsl:if test="(position() mod 2) = 0">
<xsl:attribute name="STYLE">font : x-small Arial, Helvetica, sans-serif;</xsl:attribute>
</xsl:if>
<td STYLE="font : bold;" width="50%">
<a>
<xsl:attribute name="HREF"><xsl:value-of select="url"></xsl:value-of></xsl:attribute>
<xsl:attribute name="STYLE">text-decoration : none;</xsl:attribute>
<xsl:attribute name="TARGET">_blank</xsl:attribute>
<xsl:value-of select="headline_text"></xsl:value-of>
</a>
</td>
<td STYLE="font-variant : small-caps;">
<a>
<xsl:attribute name="HREF"><xsl:value-of select="document_url"></xsl:value-of></xsl:attribute>
<xsl:attribute name="STYLE">text-decoration : none;</xsl:attribute>
<xsl:attribute name="TARGET">_blank</xsl:attribute>
<xsl:value-of select="source"></xsl:value-of>
</a>
</td>
<td>
<xsl:value-of select="harvest_time"></xsl:value-of>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/news/news.xsl
Index: news.xsl
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ns0="http://foo.bar.com/myspace"
xmlns:ns1="http://foo.bar.com/slashdot"
xmlns:ns2="http://foo.bar.com/moreover"
xmlns:ns3="http://foo.bar.com/xmlhack">
<xsl:include href="../page/simple-page2html.xsl"/>
<!-- Match The Root Node -->
<xsl:template match="ns0:page">
<html>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="ns1:news">
<xsl:apply-templates select="ns1:HTML/ns1:BODY/*"/>
</xsl:template>
<xsl:template match="ns2:news">
<xsl:apply-templates select="ns2:HTML/ns2:BODY/*"/>
</xsl:template>
<xsl:template match="ns3:news">
<xsl:apply-templates select="ns3:html/ns3:body/*"/>
</xsl:template>
<xsl:template match="@*|*|text()" priority="-1">
<xsl:copy>
<xsl:apply-templates select="@*|*|text()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/news/slashdot.xsl
Index: slashdot.xsl
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
[XSL-XSLT] This stylesheet automatically updated from an IE5-compatible XSL stylesheet to XSLT.
The following problems which need manual attention may exist in this stylesheet:
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- [XSL-XSLT] Simulate lack of built-in templates -->
<xsl:template match="@*|/|node()"/>
<!-- Match The Root Node -->
<xsl:template match="/">
<HTML>
<BODY>
<xsl:apply-templates select="*"></xsl:apply-templates>
</BODY>
</HTML>
</xsl:template>
<!-- Match Everything Else -->
<xsl:template match="*|@*|text()|node()|comment()|processing-instruction()">
<xsl:copy>
<xsl:apply-templates select="*|@*|text()|node()|comment()|processing-instruction()"></xsl:apply-templates>
</xsl:copy>
</xsl:template>
<!-- Individual Templates -->
<xsl:template match="backslash">
<table border="0" width="100%">
<tr>
<td colspan="5" STYLE="background-color : #B0E0E6; font : x-small Arial, Helvetica, sans-serif;">
<CENTER>
<b>Current News from Slashdot</b>
</CENTER>
</td>
</tr>
<xsl:apply-templates select="story"></xsl:apply-templates>
</table>
</xsl:template>
<xsl:template match="story">
<tr>
<xsl:if test="(position() mod 2) = 1">
<xsl:attribute name="STYLE">background-color : lightgrey; font : x-small Arial, Helvetica, sans-serif;</xsl:attribute>
</xsl:if>
<xsl:if test="(position() mod 2) = 0">
<xsl:attribute name="STYLE">font : x-small Arial, Helvetica, sans-serif;</xsl:attribute>
</xsl:if>
<td>
<CENTER>
<IMG WIDTH="25" HEIGHT="25" BORDER="0">
<xsl:attribute name="SRC"><xsl:value-of select="image"></xsl:value-of></xsl:attribute>
<xsl:attribute name="ALT"><xsl:value-of select="image"></xsl:value-of></xsl:attribute>
</IMG>
</CENTER>
</td>
<td STYLE="font : bold;" width="50%">
<a>
<xsl:attribute name="HREF"><xsl:value-of select="url"></xsl:value-of></xsl:attribute>
<xsl:attribute name="STYLE">text-decoration : none;</xsl:attribute>
<xsl:attribute name="TARGET">_blank</xsl:attribute>
<xsl:value-of select="title"></xsl:value-of>
</a>
</td>
<td STYLE="font-variant : small-caps;">
<xsl:value-of select="topic"></xsl:value-of>
</td>
<td STYLE="font-variant : small-caps;">
<xsl:value-of select="author"></xsl:value-of>
</td>
<td>
<xsl:value-of select="time"></xsl:value-of>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/news/xmlhack.xsl
Index: xmlhack.xsl
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- Match The Root Node -->
<xsl:template match="/">
<html>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="CHANNEL">
<table border="0" width="100%">
<tr>
<td colspan="3" style="background-color: #B0E0E6; font: x-small Arial, Helvetica, sans-serif;">
<center><b>Current News from xmlhack.com</b></center>
</td>
</tr>
<xsl:apply-templates select="ITEM"/>
</table>
</xsl:template>
<xsl:template match="ITEM">
<tr>
<xsl:if test="(position() mod 2) = 1">
<xsl:attribute name="style">background-color: lightgrey; font: x-small Arial, Helvetica, sans-serif;</xsl:attribute>
</xsl:if>
<xsl:if test="(position() mod 2) = 0">
<xsl:attribute name="style">background-color: #C0C0C0; font: x-small Arial, Helvetica, sans-serif;</xsl:attribute>
</xsl:if>
<td STYLE="font: bold;" width="75%">
<a target="_blank" style="text-decoration: none;" href="{@href}">
<xsl:value-of select="TITLE"/>
</a>
</td>
<td>
<xsl:value-of select="@LASTMOD"/>
</td>
</tr>
<tr>
<td colspan="3">
<xsl:value-of select="ABSTRACT"/>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/page/simple-page2fo.xsl
Index: simple-page2fo.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="page"
page-height="29.7cm"
page-width="21cm"
margin-top="1cm"
margin-bottom="2cm"
margin-left="2.5cm"
margin-right="2.5cm">
<fo:region-before extent="3cm"/>
<fo:region-body margin-top="3cm"/>
<fo:region-after extent="1.5cm"/>
</fo:simple-page-master>
<fo:page-sequence-master master-name="all">
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference master-reference="page" page-position="first"/>
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="all">
<fo:static-content flow-name="xsl-region-after">
<fo:block text-align="center"
font-size="10pt"
font-family="serif"
line-height="14pt">page <fo:page-number/></fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<xsl:apply-templates/>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
<xsl:template match="title">
<fo:block font-size="36pt" space-before.optimum="24pt" text-align="center"><xsl:apply-templates/></fo:block>
</xsl:template>
<xsl:template match="para">
<fo:block font-size="12pt" space-before.optimum="12pt" text-align="center"><xsl:apply-templates/></fo:block>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/page/simple-page2html.xsl
Index: simple-page2html.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="view-source"/>
<xsl:param name="path">../</xsl:param>
<xsl:template match="page">
<html>
<head>
<title>
<xsl:value-of select="title"/>
</title>
</head>
<body bgcolor="white" alink="red" link="blue" vlink="blue">
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="title">
<h2 style="color: navy; text-align: center">
<xsl:if test="not($view-source)">
<xsl:apply-templates/>
</xsl:if>
<xsl:if test="$view-source">
<A>
<xsl:attribute name="HREF"><xsl:value-of select="$path"/>view-source?filename=/<xsl:value-of select="$view-source"/></xsl:attribute>
<xsl:attribute name="TARGET">_blank</xsl:attribute>
<xsl:apply-templates/>
</A>
</xsl:if>
</h2>
</xsl:template>
<xsl:template match="content">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="para">
<p align="left">
<i><xsl:apply-templates/></i>
</p>
</xsl:template>
<xsl:template match="@*|node()" priority="-2"><xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy></xsl:template>
<xsl:template match="text()" priority="-1"><xsl:value-of select="."/></xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/page/simple-page2svg.xsl
Index: simple-page2svg.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="page">
<svg width="450" height="160">
<defs>
<filter id="blur1"><feGaussianBlur stdDeviation="3"/></filter>
<filter id="blur2"><feGaussianBlur stdDeviation="1"/></filter>
</defs>
<g title="this is a tooltip">
<rect
style="fill:#0086B3;stroke:#000000;stroke-width:4;filter:url(#blur1);"
x="30" y="30" rx="20" ry="20" width="400" height="80"/>
<xsl:apply-templates/>
</g>
</svg>
</xsl:template>
<xsl:template match="para">
<text style="fill:#FFFFFF;font-size:24;font-family:TrebuchetMS-Bold;filter:url(#blur2);" x="65" y="80">
<xsl:apply-templates/>
</text>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/page/simple-page2vml.xsl
Index: simple-page2vml.xsl
===================================================================
<?xml version="1.0"?>
<!-- Written by Theodore B. Achacoso, MD 991122 ted@groupserve.com -->
<!--
The code is based on Motorola's VoxML (Version 1.2) implementation of
the emerging VoiceXML standard (version 0.9 as of 17 August '99).
Foremost is the absence of <form></form> tags that delineate input. That
said, when this file is rendered in Motorola's Mobile ADK simulator
(MADK, version 1 beta 4 this November) the interaction looks like this:
Computer: Hello world! This is my first voice enabled cocoon page.
If user says "repeat" then the computer repeats the prompt.
If the user says "goodbye" then the computer says "Goodbye" and ends the
session.
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="page">
<DIALOG>
<STEP NAME="init">
<PROMPT><xsl:apply-templates/></PROMPT>
<INPUT TYPE="OPTIONLIST">
<OPTION NEXT="#init">repeat</OPTION>
<OPTION NEXT="#goodbye">goodbye</OPTION>
</INPUT>
</STEP>
<STEP NAME="goodbye">
<PROMPT>Goodbye</PROMPT>
<INPUT TYPE="NONE" NEXT="#end"/>
</STEP>
</DIALOG>
</xsl:template>
<xsl:template match="title">
<!-- ignore -->
</xsl:template>
<xsl:template match="para">
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/page/simple-page2vrml.xsl
Index: simple-page2vrml.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="page">
<!--
due to a DOM limitation, you must wrap your generated VRML
with a fake tag, here uses <vrml>, that is stripped out by the
text formatter
-->
<vrml><xsl:text>#VRML V2.0 utf8</xsl:text>
<xsl:apply-templates select="content"/>
</vrml>
</xsl:template>
<xsl:template match="content">
<xsl:text>
Transform {
translation 0 0 9
rotation 0 0 1 0.0
children Shape {
appearance DEF WHITE Appearance {
material Material {
diffuseColor 1 1 1
}
}
geometry Text {
string [ " </xsl:text><xsl:value-of select="para"/><xsl:text> " ]
fontStyle DEF MFS FontStyle {
size 0.1
family "SERIF"
style "BOLD"
justify "MIDDLE"
}
}
}
}
</xsl:text>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/page/simple-page2wml.xsl
Index: simple-page2wml.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="page">
<wml>
<card id="index" title="{title}">
<xsl:apply-templates select="content"/>
<do type="accept" label="About">
<go href="#about"/>
</do>
</card>
<card id="about" title="About">
<onevent type="ontimer">
<prev/>
</onevent>
<timer value="25"/>
<p align="center">
<br/>
<br/>
<small>
Copyright © 2000<br/>
Apache Software Foundation.<br/>
All rights reserved.
</small>
</p>
</card>
</wml>
</xsl:template>
<xsl:template match="para">
<p align="center">
<xsl:apply-templates/>
</p>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/parentcm/time.xsl
Index: time.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<html>
<head>
<title>Sample of Parent Component Managers</title>
</head>
<body alink="#743e75" vlink="#00698c" link="#0086b2" bgcolor="#ffffff">
<table width="100%" height="100%">
<tr>
<td valign="center" align="center">
<table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2" align="center">
<tr>
<td bgcolor="#0086b2" width="100%" align="left">
<font size="+1" face="arial,helvetica,sanserif" color="#ffffff">Current Time</font>
</td>
</tr>
<tr>
<td width="100%" bgcolor="#ffffff" align="center">
<p>
<font color="#000000" face="arial,helvetica,sanserif" size="+0">
The time below was obtained from a component managed by Cocoon2's parent component manager.<br/>
See <a href="documents/parent-component-manager">parent-component-manager.xml</a> for more information.
</font>
</p>
<p>
<font color="#000000" face="arial,helvetica,sanserif" size="+4">
<xsl:value-of select="time"/>
</font>
</p>
<p>
<font color="#000000" face="arial,helvetica,sanserif" size="+0">
<a href="./">Back</a>
</font>
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/sitemap/simple-sitemap2html.xsl
Index: simple-sitemap2html.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:map="http://apache.org/cocoon/sitemap/1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<meta name="Author" content="{author}"/>
<meta name="Version" content="{version}"/>
<title>The Sitemap</title>
<link rel="stylesheet" type="text/css" href="sitemap-style" title="Style"/>
</head>
<body bgcolor="white">
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="map:sitemap">
<h1>The Sitemap</h1>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="map:components">
<h2>Components</h2>
<table border="0" width="100%" bgcolor="navy" cellspacing="0" cellpadding="0">
<tr>
<td>
<table border="0" width="100%" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="lightgrey">
<table border="0" width="100%" cellspacing="2" cellpadding="0">
<xsl:apply-templates select="map:generators"/>
<xsl:apply-templates select="map:transformers"/>
<xsl:apply-templates select="map:readers"/>
<xsl:apply-templates select="map:serializers"/>
<xsl:apply-templates select="map:selectors"/>
<xsl:apply-templates select="map:matchers"/>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="map:views">
<h2>Views</h2>
<table border="0" width="100%" bgcolor="navy" cellspacing="0" cellpadding="0">
<tr>
<td>
<table border="0" width="100%" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="lightgrey">
<table border="0" width="100%" cellspacing="2" cellpadding="0">
<tr>
<td colspan="2" bgcolor="white"><b>Name</b></td>
<td bgcolor="white"><b>Arguments</b></td>
</tr>
<xsl:apply-templates select="map:match|map:select|map:redirect-to|map:generate|map:transform|map:select|map:read"/>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="map:resources">
<h2>Resources</h2>
<table border="0" width="100%" bgcolor="navy" cellspacing="0" cellpadding="0">
<tr>
<td>
<table border="0" width="100%" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="lightgrey">
<table border="0" width="100%" cellspacing="2" cellpadding="0">
<tr>
<td colspan="3" bgcolor="white"><b>Name</b></td>
</tr>
<xsl:apply-templates/>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="map:pipelines">
<h2>Pipelines</h2>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="map:generators">
<xsl:call-template name="show-components">
<xsl:with-param name="type">Generators</xsl:with-param>
<xsl:with-param name="comp-type">generator</xsl:with-param>
<xsl:with-param name="default" select="@default"/>
<xsl:with-param name="components" select="./*"/>
<xsl:with-param name="label">true</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="map:transformers">
<xsl:call-template name="break"/>
<xsl:call-template name="show-components">
<xsl:with-param name="type">Transformers</xsl:with-param>
<xsl:with-param name="comp-type">transformer</xsl:with-param>
<xsl:with-param name="default" select="@default"/>
<xsl:with-param name="components" select="./*"/>
<xsl:with-param name="label">true</xsl:with-param>
<xsl:with-param name="break">true</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="map:readers">
<xsl:call-template name="break"/>
<xsl:call-template name="show-components">
<xsl:with-param name="type">Readers</xsl:with-param>
<xsl:with-param name="comp-type">reader</xsl:with-param>
<xsl:with-param name="default" select="@default"/>
<xsl:with-param name="components" select="./*"/>
<xsl:with-param name="break">true</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="map:serializers">
<xsl:call-template name="break"/>
<xsl:call-template name="show-components">
<xsl:with-param name="type">Serializers</xsl:with-param>
<xsl:with-param name="comp-type">serializer</xsl:with-param>
<xsl:with-param name="default" select="@default"/>
<xsl:with-param name="components" select="./*"/>
<xsl:with-param name="break">true</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="map:selectors">
<xsl:call-template name="break"/>
<xsl:call-template name="show-components">
<xsl:with-param name="type">Selectors</xsl:with-param>
<xsl:with-param name="comp-type">selector</xsl:with-param>
<xsl:with-param name="default" select="@default"/>
<xsl:with-param name="components" select="./*"/>
<xsl:with-param name="break">true</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="map:matchers">
<xsl:call-template name="break"/>
<xsl:call-template name="show-components">
<xsl:with-param name="type">Matchers</xsl:with-param>
<xsl:with-param name="comp-type">matcher</xsl:with-param>
<xsl:with-param name="default" select="@default"/>
<xsl:with-param name="components" select="./*"/>
<xsl:with-param name="break">true</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="map:view">
<xsl:if test="preceding-sibling::map:view">
<xsl:call-template name="break"/>
</xsl:if>
<tr>
<td colspan="2" bgcolor="white"><a href=""><xsl:value-of select="@name"/></a></td>
<td bgcolor="white">generate-from="<xsl:value-of select="@generate-from"/>"</td>
</tr>
<tr>
<td bgcolor="white"> </td>
<td colspan="2" bgcolor="white">
<xsl:apply-templates/>
</td>
</tr>
</xsl:template>
<xsl:template match="map:resource">
<xsl:if test="preceding-sibling::map:resource">
<xsl:call-template name="break"/>
</xsl:if>
<tr>
<td colspan="3" bgcolor="white"><a href=""><xsl:value-of select="@name"/></a></td>
</tr>
<tr>
<td bgcolor="white"> </td>
<td colspan="2" bgcolor="white">
<xsl:apply-templates/>
</td>
</tr>
</xsl:template>
<xsl:template match="map:pipeline">
<table border="0" width="100%" bgcolor="navy" cellspacing="0" cellpadding="0">
<tr>
<td>
<table border="0" width="100%" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="lightgrey">
<table border="0" width="100%" cellspacing="2" cellpadding="0">
<xsl:apply-templates/>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br/>
</xsl:template>
<xsl:template match="map:match">
<xsl:choose>
<xsl:when test="ancestor::*[self::map:pipeline]">
<tr>
<td bgcolor="white">
<xsl:call-template name="indent"/>
<a href="">match</a>
<xsl:if test="@type">
type="<xsl:value-of select="@type"/>"
</xsl:if>
pattern="<xsl:value-of select="@pattern"/>"
<br/>
<xsl:apply-templates/>
</td>
</tr>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="indent"/>
<a href="">match</a>
<xsl:if test="@type">
type="<xsl:value-of select="@type"/>"
</xsl:if>
pattern="<xsl:value-of select="@pattern"/>"
<br/>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="map:select">
<xsl:call-template name="indent"/>
<a href="">select</a>
<xsl:if test="@type">
type="<xsl:value-of select="@type"/>"
</xsl:if>
<br/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="map:when">
<xsl:call-template name="indent"/>
<a href="">when</a> test="<xsl:value-of select="@test"/>"<br/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="map:otherwise">
<xsl:call-template name="indent"/>
<a href="">otherwise</a><br/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="map:generate">
<xsl:call-template name="indent"/>
<a href="">generate</a>
<xsl:if test="@type">
type="<xsl:value-of select="@type"/>"
</xsl:if>
src="<xsl:value-of select="@src"/>"
<br/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="map:transform">
<xsl:call-template name="indent"/>
<a href="">transform</a>
<xsl:if test="@type">
type="<xsl:value-of select="@type"/>"
</xsl:if>
src="<xsl:value-of select="@src"/>"
<br/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="map:read">
<xsl:call-template name="indent"/>
<a href="">read</a>
<xsl:if test="@type">
type="<xsl:value-of select="@type"/>"
</xsl:if>
src="<xsl:value-of select="@src"/>"
<xsl:if test="@mime-type">
mime-type="<xsl:value-of select="@mime-type"/>"
</xsl:if>
<br/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="map:redirect-to">
<xsl:call-template name="indent"/>
<a href="">redirect-to</a>
<xsl:choose>
<xsl:when test="@uri">
uri="<xsl:value-of select="@uri"/>"
</xsl:when>
<xsl:when test="@resource">
resource="<xsl:value-of select="@resource"/>"
</xsl:when>
</xsl:choose>
<br/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="map:serialize">
<xsl:call-template name="indent"/>
<a href="">serialize</a>
<xsl:if test="@type">
type="<xsl:value-of select="@type"/>"
</xsl:if>
<xsl:if test="@mime-type">
mime-type="<xsl:value-of select="@mime-type"/>"
</xsl:if>
<br/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="map:mount">
<xsl:call-template name="indent"/>
<a href="">mount</a> src="<xsl:value-of select="@src"/>" uri-prefix="<xsl:value-of select="@uri-prefix"/>"<br/>
<xsl:if test="@check-reload">
check-reload="<xsl:value-of select="@check-reload"/>"
</xsl:if>
<br/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="map:handle-errors">
<tr>
<td bgcolor="white">
<xsl:call-template name="indent"/>
<a href="">handle-errors</a>
<br/>
<xsl:apply-templates/>
</td>
</tr>
</xsl:template>
<!-- named templates -->
<xsl:template name="show-components">
<xsl:param name="type"/>
<xsl:param name="comp-type"/>
<xsl:param name="default"/>
<xsl:param name="components"/>
<xsl:param name="label"/>
<tr>
<td colspan="3" bgcolor="white">
<span class="h3"><xsl:value-of select="$type"/> (default=<i><xsl:value-of select="$default"/></i>)</span>
</td>
</tr>
<tr>
<td bgcolor="white"><b>Name</b></td>
<xsl:choose>
<xsl:when test="$label">
<td bgcolor="white"><b>Class</b></td>
<td bgcolor="white"><b>Label</b></td>
</xsl:when>
<xsl:otherwise>
<td colspan="2" bgcolor="white"><b>Class</b></td>
</xsl:otherwise>
</xsl:choose>
</tr>
<xsl:for-each select="$components">
<tr>
<td bgcolor="white"><a href="sitemap-component?component={$comp-type}&name={@name}"><xsl:value-of select="@name"/></a></td>
<xsl:choose>
<xsl:when test="$label">
<xsl:choose>
<xsl:when test="@src">
<td bgcolor="white"><xsl:value-of select="@src"/></td>
</xsl:when>
<xsl:otherwise>
<td bgcolor="white"><i><xsl:value-of select="@factory"/></i></td>
</xsl:otherwise>
</xsl:choose>
<td bgcolor="white"><xsl:value-of select="@label"/> </td>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="@src">
<td colspan="2" bgcolor="white"><xsl:value-of select="@src"/></td>
</xsl:when>
<xsl:otherwise>
<td colspan="2" bgcolor="white"><i><xsl:value-of select="@factory"/></i></td>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</tr>
<xsl:if test="./*">
<!--
<xsl:call-template name="show-config"/>
-->
</xsl:if>
</xsl:for-each>
</xsl:template>
<xsl:template name="show-config">
<xsl:param name="indent"/>
<xsl:choose>
<xsl:when test="string-length($indent)=0">
<tr>
<td align="right">Configuration</td>
<td colspan="3">
<xsl:for-each select="./*">
 <xsl:value-of select="name()"/>
<xsl:if test="./*">
<xsl:call-template name="show-config">
<xsl:with-param name="indent"> <xsl:value-of select="$indent"/></xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:for-each>
</td>
</tr>
</xsl:when>
<xsl:otherwise>
<tr>
<td align="right"> </td>
<td colspan="3">
<xsl:for-each select="./*">
 <xsl:value-of select="name()"/>=<xsl:value-of select="text()"/>
<xsl:if test="./*">
<xsl:call-template name="show-config">
<xsl:with-param name="indent"> <xsl:value-of select="$indent"/></xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:for-each>
</td>
</tr>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="break">
<tr>
<td colspan="3" bgcolor="white"><hr color="navy"/></td>
</tr>
</xsl:template>
<xsl:template name="indent">
<xsl:for-each select="ancestor::*">
<xsl:choose>
<xsl:when test="local-name(.)='pipeline'">
</xsl:when>
<xsl:when test="local-name(.)='pipelines'">
</xsl:when>
<xsl:when test="local-name(.)='sitemap'">
</xsl:when>
<xsl:when test="local-name(.)='resource'">
</xsl:when>
<xsl:when test="local-name(.)='resources'">
</xsl:when>
<xsl:when test="local-name(.)='view'">
</xsl:when>
<xsl:when test="local-name(.)='views'">
</xsl:when>
<xsl:otherwise>
  
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<xsl:template match="*|@*|text()|comment()|processing-instruction()" priority="-1"/>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/sites/jakarta_apache_org-html.xsl
Index: jakarta_apache_org-html.xsl
===================================================================
<?xml version="1.0"?>
<!-- Author: Stefano Mazzocchi "stefano@apache.org" -->
<!-- Version: $Id: jakarta_apache_org-html.xsl,v 1.1 2002/07/02 13:06:41 cziegeler Exp $ -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="page">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title><xsl:value-of select="@title"/></title>
<link rel="stylesheet" href="styles/jakarta_apache_org.css"><!-- no not remove this comment --></link>
</head>
<body bgcolor="#FFFFFF">
<table width="100%" border="0">
<tr>
<td>
<p>
<a href="welcome"><img src="{/page/logo/@href}"
alt="The Jakarta Project" border="0"/></a>
</p>
</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="10" cellspacing="0">
<tr valign="top">
<xsl:apply-templates/>
</tr>
</table>
<br/>
<table width="100%" border="0" cellpadding="10" cellspacing="0">
<tr>
<td>
<p class="fineprint">
Copyright © 1999-2000 The Apache Software Foundation<br/>
<a href="legal.html">Legal Stuff They Make Us Say</a><br/>
<a href="contact.html">Contact Information</a>
</p>
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="sidebar">
<td width="120">
<xsl:apply-templates/>
</td>
</xsl:template>
<xsl:template match="body">
<td>
<xsl:apply-templates/>
</td>
</xsl:template>
<xsl:template match="group">
<p>
<span class="navheading"><xsl:value-of select="@name"/><xsl:text>:</xsl:text></span><br/>
<span class="navitem">
<xsl:apply-templates/>
</span>
</p>
</xsl:template>
<xsl:template match="section">
<h3><xsl:value-of select="@title"/></h3>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="p|a">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="link">
<a href="{@href}"><xsl:apply-templates/></a><br/>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/sites/java_apache_org-html.xsl
Index: java_apache_org-html.xsl
===================================================================
<?xml version="1.0"?>
<!-- Author: Stefano Mazzocchi "stefano@apache.org" -->
<!-- Version: $Id: java_apache_org-html.xsl,v 1.1 2002/07/02 13:06:41 cziegeler Exp $ -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="page">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<meta name="Author" content="{author}"/>
<meta name="Version" content="{version}"/>
<title><xsl:value-of select="title"/></title>
</head>
<body bgcolor="#ffffff">
<center>
<table border="0" width="100%" bgcolor="#000000" cellspacing="0" cellpadding="0">
<tr>
<td>
<table border="0" width="100%" cellspacing="2" cellpadding="5">
<tr>
<td bgcolor="#F0F0F0">
<table border="0" width="100%" cellspacing="0" cellpadding="3">
<tr>
<td width="100%" align="center">
<table border="0" width="100%" cellspacing="10">
<tr>
<td valign="top" width="60%">
<xsl:apply-templates select="newscolumn"/>
</td>
<td valign="top" width="40%">
<xsl:apply-templates select="statuscolumn"/>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" align="left">
<small><small>
<xsl:value-of select="legal"/>
</small></small>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</body>
</html>
</xsl:template>
<xsl:template match="newscolumn">
<table border="0" width="100%" bgcolor="#000000" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">
<table border="0" width="100%" cellpadding="4">
<tr>
<td bgcolor="#C0C0C0" align="right">
<big><big><b><xsl:text>News</xsl:text></b></big></big>
</td>
</tr>
<xsl:apply-templates/>
</table>
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="news">
<tr>
<td bgcolor="#E0E0E0" align="left">
<a href="{link}">
<strong><xsl:value-of select="title"/></strong>
</a>
</td>
</tr>
<tr>
<td bgcolor="#ffffff" align="left">
<strong><xsl:value-of select="date"/></strong>
<xsl:text> - </xsl:text>
<xsl:value-of select="content"/>
</td>
</tr>
</xsl:template>
<xsl:template match="statuscolumn">
<table border="0" width="100%" bgcolor="#000000" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">
<table border="0" width="100%" cellpadding="4">
<tr>
<td bgcolor="#C0C0C0" colspan="2" align="right">
<big><big><b><xsl:text>Status</xsl:text></b></big></big>
</td>
</tr>
<xsl:apply-templates/>
</table>
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="project">
<tr>
<td bgcolor="#E0E0E0" colspan="2" align="left">
<a href="{link}">
<b><xsl:value-of select="title"/></b>
</a>
</td>
</tr>
<xsl:apply-templates select="release"/>
</xsl:template>
<xsl:template match="release">
<tr>
<td bgcolor="#FFFFFF" align="center" rowspan="2">
<b><xsl:value-of select="version"/></b>
</td>
<td bgcolor="#D0FFD0" align="left">
<b><xsl:value-of select="status"/></b>
</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" align="left">
<small><xsl:value-of select="comment"/></small>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/slides/slides-apachecon.xsl
Index: slides-apachecon.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="slide">
<html>
<head>
<title><xsl:value-of select="title"/></title>
<link rel="stylesheet" type="text/css" href="style" title="Style"/>
</head>
<body bgcolor="white">
<table width="100%">
<tr>
<td>
<table width="100%">
<tr>
<td width="100%"><img src="../images/cocoon.gif" border="0"/></td>
<td>
<xsl:apply-templates select="navigation"/>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<div id="main">
<xsl:apply-templates select="layout"/>
</div>
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="navigation">
<table>
<tr>
<td>
<xsl:if test="previous">
<a href="{previous/@href}"><img src="../images/slides/previous.png" border="0"/></a>
</xsl:if>
<xsl:if test="not(previous)">
<img src="../images/slides/previous.png" border="0"/>
</xsl:if>
</td>
<td>
<xsl:if test="previous-section">
<a href="{previous-section/@href}"><img src="../images/slides/previous-section.png" border="0"/></a>
</xsl:if>
<xsl:if test="not(previous-section)">
<img src="../images/slides/previous-section.png" border="0"/>
</xsl:if>
</td>
<td>
<xsl:if test="home">
<a href="{home/@href}"><img src="../images/slides/home.png" border="0"/></a>
</xsl:if>
<xsl:if test="not(home)">
<img src="../images/slides/home.png" border="0"/>
</xsl:if>
</td>
<td>
<xsl:if test="next-section">
<a href="{next-section/@href}"><img src="../images/slides/next-section.png" border="0"/></a>
</xsl:if>
<xsl:if test="not(next-section)">
<img src="../images/slides/next-section.png" border="0"/>
</xsl:if>
</td>
<td>
<xsl:if test="next">
<a href="{next/@href}"><img src="../images/slides/next.png" border="0"/></a>
</xsl:if>
<xsl:if test="not(next)">
<img src="../images/slides/next.png" border="0"/>
</xsl:if>
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="layout">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="p|ol|ul|li|em|strong|br">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="fork">
<a href="{@uri}" target="_blank">
<xsl:apply-templates/>
</a>
</xsl:template>
<xsl:template match="link">
<a href="{@uri}">
<xsl:apply-templates/>
</a>
</xsl:template>
<xsl:template match="title">
<h1>
<xsl:apply-templates/>
</h1>
</xsl:template>
<xsl:template match="subtitle">
<h3>
<xsl:text> [</xsl:text>
<xsl:apply-templates/>
<xsl:text>]</xsl:text>
</h3>
</xsl:template>
<xsl:template match="quote">
<p class="quote">
<xsl:apply-templates/>
</p>
</xsl:template>
<xsl:template match="source">
<pre>
<xsl:apply-templates/>
</pre>
</xsl:template>
<xsl:template match="figure">
<p class="figure" align="center">
<img src="{@src}"/>
</p>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/slides/slides-navigation.xsl
Index: slides-navigation.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="section"/>
<xsl:param name="slide"/>
<xsl:template match="slides">
<slide style="{@style}">
<xsl:if test="not($section)">
<title>
<xsl:value-of select="title"/>
</title>
<navigation>
<next href="?section=1"/>
</navigation>
<layout>
<title><a href="?section=1"><xsl:value-of select="title"/></a></title>
<subtitle>
<xsl:for-each select="authors/person">
<xsl:value-of select="name"/>
<xsl:text> (</xsl:text>
<xsl:value-of select="email"/>
<xsl:text>)</xsl:text>
</xsl:for-each>
</subtitle>
<quote><xsl:value-of select="overview"/></quote>
</layout>
</xsl:if>
<xsl:if test="$section">
<xsl:if test="not($slide)">
<xsl:apply-templates select="//section[position() = $section]"/>
</xsl:if>
<xsl:if test="$slide">
<xsl:apply-templates select="//section[position() = $section]/slide[position() = $slide]"/>
</xsl:if>
</xsl:if>
</slide>
</xsl:template>
<!-- ================================ Section ============================== -->
<xsl:template match="section">
<title>
<xsl:value-of select="title"/>
</title>
<navigation>
<xsl:variable name="last">
<xsl:value-of select="count(//section)"/>
</xsl:variable>
<xsl:variable name="previous-last">
<xsl:value-of select="count(//section[position() = ($section - 1)]/slide)"/>
</xsl:variable>
<home href=""/>
<xsl:if test="$section!=1">
<previous-section href="?section={$section - 1}"/>
<previous href="?section={$section - 1}&slide={$previous-last}"/>
</xsl:if>
<xsl:if test="$section!=$last">
<next-section href="?section={$section + 1}"/>
</xsl:if>
<next href="?section={$section}&slide=1"/>
</navigation>
<layout>
<title><xsl:value-of select="title"/></title>
<subtitle><xsl:value-of select="subtitle"/></subtitle>
</layout>
</xsl:template>
<!-- ================================ Slide ============================== -->
<xsl:template match="slide">
<title>
<xsl:value-of select="title"/>
</title>
<navigation>
<xsl:variable name="last-section">
<xsl:value-of select="count(//section)"/>
</xsl:variable>
<xsl:variable name="last">
<xsl:value-of select="count(//section[position() = $section]/slide)"/>
</xsl:variable>
<xsl:variable name="previous-last">
<xsl:value-of select="count(//section[position() = ($section - 1)]/slide)"/>
</xsl:variable>
<home href="?section={$section}"/>
<xsl:if test="$slide!=1">
<previous href="?section={$section}&slide={$slide - 1}"/>
</xsl:if>
<xsl:if test="($slide=1)">
<previous href="?section={$section}"/>
</xsl:if>
<xsl:if test="$slide!=$last">
<next href="?section={$section}&slide={$slide + 1}"/>
</xsl:if>
<xsl:if test="($slide=$last) and ($section!=$last-section)">
<next href="?section={$section + 1}"/>
</xsl:if>
<xsl:if test="$section!=1">
<previous-section href="?section={$section - 1}"/>
</xsl:if>
<xsl:if test="$section!=$last-section">
<next-section href="?section={$section + 1}"/>
</xsl:if>
</navigation>
<layout>
<xsl:apply-templates/>
</layout>
</xsl:template>
<xsl:template match="*|@*|text()">
<xsl:copy>
<xsl:apply-templates select="*|@*|text()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/system/directory2html.xsl
Index: directory2html.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dir="http://apache.org/cocoon/directory/2.0">
<xsl:template match="/">
<html>
<head>
<title><xsl:value-of select="dir:directory/@name"/></title>
<style>
<xsl:comment>
body { background-color: #ffffff }
</xsl:comment>
</style>
</head>
<body>
<h1>Directory Listing of <xsl:value-of select="dir:directory/@name"/></h1>
<table border="0">
<tr>
<td><a href="../"><i>parent directory</i></a></td>
</tr>
<tr>
<td> </td>
</tr>
<xsl:apply-templates/>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="dir:directory/dir:directory">
<tr>
<td><a href="{@name}/"><i><xsl:value-of select="@name"/></i></a></td>
<td><xsl:value-of select="@date"/></td>
</tr>
</xsl:template>
<xsl:template match="dir:file">
<tr>
<td><a href="{@name}"><xsl:value-of select="@name"/></a></td>
<td><xsl:value-of select="@date"/></td>
</tr>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/system/error2html.xsl
Index: error2html.xsl
===================================================================
<?xml version="1.0"?>
<!-- Author: Nicola Ken Barozzi "barozzi@nicolaken.com" -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:error="http://apache.org/cocoon/error/2.0">
<xsl:template match="error:notify">
<html>
<head>
<title>
<xsl:value-of select="@error:type"/>:<xsl:value-of select="error:title"/>
</title>
<style><![CDATA[
<!--
H1{font-family : sans-serif,Arial,Tahoma;color : white;background-color : #0086b2;}
BODY{font-family : sans-serif,Arial,Tahoma;color : black;background-color : white;}
TABLE{font-family : sans-serif,Arial,Tahoma;color : black;background-color : black;}
B{color : white;background-color : #0086b2;}
HR{color : #0086b2;}
//-->]]>
</style>
<script language="JavaScript1.2"><![CDATA[
<!--
var head="display:''"
function expand(whatToExpand)
{
var head=whatToExpand.style
if (head.display=="none"){
head.display=""
}
else{
head.display="none"
}
}
//-->]]>
</script>
</head>
<body>
<table align="center" border="0" bgcolor="#000000" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td>
<table align="center" border="0" bgcolor="#000000" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td bgcolor="#0086b2" colspan="2">
<font color="#ffffff" size="+2">
<xsl:value-of select="error:title"/>
</font>
</td>
</tr>
<tr>
<td bgcolor="#ffffff" colspan="2" valign="top">
<font color="#000000">
The <xsl:value-of select="@error:sender"/> notifies that
<xsl:value-of select="error:source"/> says:<br/><br/>
<i><xsl:call-template name="returns2br">
<xsl:with-param name="string" select="error:message"/>
</xsl:call-template></i><br/><br/>
More precisely:<br/><br/>
<i><xsl:call-template name="returns2br">
<xsl:with-param name="string" select="error:description"/>
</xsl:call-template></i><br/>
<br/>
</font>
</td>
</tr>
<!--
<tr>
<td bgcolor="#0086b2" valign="top">
<font color="#ffffff" size="+1">
<xsl:value-of select="@error:type"/>
</font>
</td>
<td bgcolor="#ffffff" >
<xsl:apply-templates select="error:message"/>
</td>
</tr>
<tr>
<td bgcolor="#0086b2" valign="top" colspan="2">
<font color="#ffffff" size="+1">details</font>
</td>
</tr>
<tr>
<td bgcolor="#0086b2" valign="top">
<font color="#ffffff">from</font>
</td>
<td bgcolor="#ffffff">
<font face="arial,helvetica,sanserif">
<xsl:value-of select="@error:sender"/>
</font>
</td>
</tr>
<tr>
<td bgcolor="#0086b2" valign="top">
<font color="#ffffff">source</font>
</td>
<td bgcolor="#ffffff">
<font face="arial,helvetica,sanserif">
<xsl:value-of select="error:source"/>
</font>
</td>
</tr>
<xsl:apply-templates select="error:description"/>
-->
<tr>
<td bgcolor="#0086b2" valign="top" colspan="2">
<font color="#ffffff" size="+1">extra info</font>
</td>
</tr>
<xsl:apply-templates select="error:extra"/>
<tr>
<td bgcolor="#ffffff" colspan="2" valign="top">
<font color="#000000" size="-1">
<br/>
If you need help and this information is not enough, you
are invited to read the <a href="http://xml.apache.org/cocoon/faq.html">cocoon faq</a>.<br/>
If you still don't find the answers you need,
can send a mail to the
<a>
<xsl:attribute name="href">mailto:cocoon-users@xml.apache.org?subject=[HELP]<xsl:value-of select="error:message"/>&body=Description:<xsl:value-of select="error:description"/></xsl:attribute>
Cocoon users mailing list</a>,
remembering to
<ul>
<li> specify the version of Cocoon you're using, or we suppose that you
are talking about the latest version;</li>
<li>specify the taglibs and sitemap components that are pertinent;</li>
<li>specify the platform-operating system-version-servlet container version;</li>
<li>send any pertinent error message;</li>
<li>send pertinent log snippets;</li>
<li>send pertinent sitemap snippets;</li>
<li>send pertinent parts of the page that gives you problems.</li>
</ul>
For more detailed technical information, take a look at the log
files in the log directory of cocoon, which is <code>/WEB-INF/logs</code> by default.<br/>
Logging configuration is by default in <code>/WEB-INF/logkit.xconf.</code><br/><br/>
If you think you found a bug, please report it to
<a href="http://nagoya.apache.org/bugzilla/">Apache's Bugzilla</a>;
a message will be sent to the developer mailing list.<br/>
</font>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="error:description">
<tr>
<td bgcolor="#0086b2" valign="top">
<font color="#ffffff" face="arial,helvetica,sanserif">description</font>
</td>
<td bgcolor="#ffffff">
<xsl:call-template name="returns2br">
<xsl:with-param name="string" select="."/>
</xsl:call-template>
</td>
</tr>
</xsl:template>
<xsl:template match="error:message">
<xsl:call-template name="returns2br">
<xsl:with-param name="string" select="."/>
</xsl:call-template>
</xsl:template>
<xsl:template match="error:extra">
<tr>
<td bgcolor="#0086b2" valign="top">
<font color="#ffffff">
<xsl:value-of select="@error:description"/>
</font>
</td>
<td bgcolor="#ffffff">
<font size="-1">
<xsl:choose>
<xsl:when test="contains(@error:description,'stacktrace')">
<!-- degrade gracefully on Netscape-->
<a href="javascript:" onclick="expand(document.all[this.sourceIndex+2])"><script>if(document.all){document.write('show');}</script></a>
<div style="display:'none';">
<xsl:call-template name="returns2br">
<xsl:with-param name="string" select="."/>
</xsl:call-template>
</div>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="returns2br">
<xsl:with-param name="string" select="."/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</font>
</td>
</tr>
</xsl:template>
<xsl:template name="returns2br">
<xsl:param name="string"/>
<xsl:variable name="return" select="'
'"/>
<xsl:choose>
<xsl:when test="contains($string,$return)">
<xsl:value-of select="substring-before($string,$return)"/>
<br/>
<xsl:call-template name="returns2br">
<xsl:with-param name="string" select="substring-after($string,$return)"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$string"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/system/profile2html.xsl
Index: profile2html.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:profile="http://apache.org/cocoon/profiler/1.0">
<xsl:param name="sort"/>
<xsl:template match="profile:profilerinfo">
<html>
<head>
<title>Cocoon2 profile information [<xsl:value-of select="@profile:date"/>]</title>
</head>
<body>
Sort results by <a href="?sort=uri">uri</a>,
<a href="?sort=count">count</a>, <a href="?sort=time">time</a>.
<table noshade="noshade" border="0" cellspacing="1" cellpadding="0" width="100%">
<xsl:choose>
<xsl:when test="$sort = 'uri'">
<xsl:apply-templates>
<xsl:sort select="@profile:uri"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="$sort = 'time'">
<xsl:apply-templates>
<xsl:sort select="@profile:time" data-type="number"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="$sort = 'count'">
<xsl:apply-templates>
<xsl:sort select="@profile:count" data-type="number"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="profile:pipeline">
<xsl:if test="position() mod 5 = 1">
<tr bgcolor="#FFC0C0">
<th>NN</th>
<th>Role (Source)</th>
<th>Average</th>
<th colspan="10">Last Results</th>
</tr>
</xsl:if>
<tr bgcolor="#C0C0FF">
<td colspan="14">
<font face="verdana"><strong><xsl:value-of select="@profile:uri"/></strong></font>
(<xsl:value-of select="@profile:count"/> results,
total time: <xsl:value-of select="@profile:time"/>,
average time: <xsl:value-of select="@profile:time div @profile:count"/>)
</td>
</tr>
<!--
<xsl:for-each select="*">
<tr>
<td>
<xsl:apply-templates select="."/>
</td>
</tr>
</xsl:for-each>
-->
<xsl:for-each select="profile:average/profile:element">
<xsl:variable name="bgcolor">
<xsl:if test="position() mod 2 = 0">#D0D0D0</xsl:if>
<xsl:if test="position() mod 2 = 1">#E0E0E0</xsl:if>
</xsl:variable>
<tr bgcolor="{$bgcolor}">
<xsl:variable name="pos" select="position()"/>
<td width="1%">
<xsl:value-of select="$pos"/>
</td>
<td width="10%">
<xsl:value-of select="@profile:role"/>
<xsl:if test="@profile:source">
(<xsl:value-of select="@profile:source"/>)
</xsl:if>
</td>
<xsl:for-each select="../../profile:average/profile:element[position()=$pos]">
<th>
<xsl:value-of select="@profile:time"/>
</th>
</xsl:for-each>
<xsl:for-each select="../../profile:result/profile:element[position()=$pos]">
<td>
<xsl:value-of select="@profile:time"/>
</td>
</xsl:for-each>
</tr>
</xsl:for-each>
<xsl:variable name="pos" select="count(profile:average/profile:element)"/>
<tr>
<td width="1%">
<xsl:value-of select="$pos+1"/>
</td>
<td width="10%">
TOTAL
</td>
<th>
<xsl:value-of select="profile:average/@profile:time"/>
</th>
<xsl:for-each select="profile:result">
<td>
<xsl:value-of select="@profile:time"/>
</td>
</xsl:for-each>
</tr>
</xsl:template>
<xsl:template match="profile:average|profile:result">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="profile:element">
<table cellspacing="0" cellpadding="0">
<tr>
<td>
<xsl:value-of select="@profile:role"/>
</td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/system/status2html.xsl
Index: status2html.xsl
===================================================================
<?xml version="1.0"?>
<!-- Author: Nicola Ken Barozzi "barozzi@nicolaken.com" -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:status="http://apache.org/cocoon/status/2.0">
<xsl:template match="status:statusinfo">
<html>
<head>
<title>Cocoon2 status [<xsl:value-of select="@status:host"/>]</title>
</head>
<body bgcolor="white">
<table bgcolor="#000000" cellspacing="0" cellpadding="2" width="97%">
<tr>
<td>
<table border="0" bgcolor="#000000" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<table bgcolor="#ffffff" noshade="noshade" cellspacing="0" cellpadding="6" width="100%">
<tr>
<td bgcolor="#0086b2" valign="top" align="left">
<img src="images/cocoon.gif" border="0"/>
</td>
<td bgcolor="#0086b2" valign="top" align="right">
<FONT face="arial,helvetica,sanserif" color="#ffffff">
[<xsl:value-of select="@status:host"/>] <xsl:value-of select="@status:date"/>
</FONT>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<xsl:call-template name="spacer">
<xsl:with-param name="height" select="number(10)"/>
</xsl:call-template>
<xsl:apply-templates />
</body>
</html>
</xsl:template>
<xsl:template match="status:group">
<table border="0" bgcolor="#000000" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<table bgcolor="#000000" border="0" cellspacing="2" cellpadding="6" width="100%">
<tr>
<td bgcolor="#0086b2" valign="top" align="left" colspan="2">
<FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1">
-<xsl:value-of select="@status:name"/>
</FONT>
</td>
</tr>
<tr>
<td bgcolor="#ffffff">
<table border="0" bgcolor="#000000" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<table width="100%" bgcolor="#000000" border="0" cellspacing="2" cellpadding="6">
<xsl:apply-templates select="status:value"/>
<xsl:call-template name="spacer">
<xsl:with-param name="height" select="number(8)"/>
</xsl:call-template>
<xsl:apply-templates select="status:group"/>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<xsl:call-template name="spacer">
<xsl:with-param name="height" select="number(6)"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="status:value">
<tr>
<td bgcolor="#0086b2" valign="top" align="left" width="1%">
<font face="arial,helvetica,sanserif" color="#ffffff">
<xsl:value-of select="@status:name"/>
</font>
</td>
<td bgcolor="#eeeeee" width="100%">
<xsl:choose>
<xsl:when test="../@status:name='memory' and ( @status:name='total' or @status:name='free')">
<font face="arial,helvetica,sanserif">
<xsl:call-template name="suffix">
<xsl:with-param
name="bytes"
select="number(.)"/>
</xsl:call-template>
</font>
</xsl:when>
<xsl:when test="count(status:line) <= 1">
<font face="arial,helvetica,sanserif">
<xsl:value-of select="status:line" />
</font>
</xsl:when>
<xsl:otherwise>
<ul>
<xsl:apply-templates />
</ul>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:template>
<xsl:template match="status:line">
<li>
<font face="arial,helvetica,sanserif">
<xsl:value-of select="." />
</font>
</li>
</xsl:template>
<xsl:template name="suffix">
<xsl:param name="bytes"/>
<xsl:choose>
<!-- More than 4 MB (=4194304) -->
<xsl:when test="$bytes >= 4194304">
<xsl:value-of select="round($bytes div 10485.76) div 100"/> MB
<small>(<xsl:value-of select="$bytes"/>)</small>
</xsl:when>
<!-- More than 4 KB (=4096) -->
<xsl:when test="$bytes > 4096">
<xsl:value-of select="round($bytes div 10.24) div 100"/> KB
<small>(<xsl:value-of select="$bytes"/>)</small>
</xsl:when>
<!-- Less -->
<xsl:otherwise>
<xsl:value-of select="$bytes"/> B
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="spacer">
<xsl:param name="height"/>
<table bgcolor="#ffffff" cellspacing="0" cellpadding="2" width="100%">
<tr>
<td bgcolor="#ffffff">
<table bgcolor="#ffffff" cellspacing="0" cellpadding="2" width="100%">
<tr>
<td width="100%" bgcolor="#ffffff" valign="top" align="left" height="$height">
</td>
</tr>
</table>
</td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/stylesheets/xmlform/xmlform2html.xsl
Index: xmlform2html.xsl
===================================================================
<?xml version="1.0" encoding="iso-8859-1" ?>
<!--
Basic XMLForm processing stylesheet.
Converts XMLForm tags to HTML tags.
Syntax is borrowed from the XForms standard.
http://www.w3.org/TR/2002/WD-xforms-20020118/
This stylesheet is usually applied at the end of a
transformation process after laying out the xmlform
tags on the page is complete. At this stage xmlform tags
are rendered in device specific format.
Different widgets are broken into templates
to allow customization in importing stylesheets
author: Ivelin Ivanov, ivelin@apache.org, June 2002
author: Andrew Timberlake <an...@timberlake.co.za>, June 2002
author: Michael Ratliff, mratliff@collegenet.com <mr...@collegenet.com>, May 2002
author: Torsten Curdt, tcurdt@dff.st, March 2002
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xf="http://xml.apache.org/cocoon/xmlform/2002"
>
<xsl:output method = "html" omit-xml-declaration = "yes" />
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="xf:form">
<form method="POST">
<xsl:copy-of select="@*"/>
<input type="hidden" name="cocoon-xmlform-view" value="{@view}"/>
<xsl:apply-templates />
</form>
</xsl:template>
<xsl:template match="xf:output">
[<xsl:value-of select="xf:value/text()"/>]
</xsl:template>
<xsl:template match="xf:textbox">
<input name="{@ref}" type="textbox" value="{xf:value/text()}">
<xsl:copy-of select="@*[not(name()='ref')]"/>
</input>
</xsl:template>
<xsl:template match="xf:password">
<input name="{@ref}" type="password" value="{xf:value/text()}">
<xsl:copy-of select="@*[not(name()='ref')]"/>
</input>
</xsl:template>
<xsl:template match="xf:hidden">
<input name="{@ref}" type="hidden" value="{xf:value/text()}">
<xsl:copy-of select="@*[not(name()='ref')]"/>
</input>
</xsl:template>
<xsl:template match="xf:selectBoolean">
<input name="{@ref}" type="checkbox" value="true">
<xsl:copy-of select="@*[not(name()='ref')]"/>
<xsl:if test="xf:value/text() = 'true'">
<xsl:attribute name="checked"/>
</xsl:if>
</input>
</xsl:template>
<xsl:template match="xf:selectOne | xf:selectOne[@selectUIType='listbox']">
<select name="{@ref}">
<xsl:copy-of select="@*[not(name()='ref')]"/>
<xsl:variable name="selected" select="xf:value"/>
<xsl:for-each select="xf:item">
<option value="{xf:value}">
<xsl:if test="$selected = xf:value">
<xsl:attribute name="selected"/>
</xsl:if>
<xsl:value-of select="xf:caption"/>
</option>
</xsl:for-each>
</select>
</xsl:template>
<xsl:template match="xf:selectOne[@selectUIType='radio']">
<xsl:variable name="selected" select="xf:value"/>
<xsl:variable name="ref" select="@ref"/>
<xsl:for-each select="xf:item">
<input name="{$ref}" type="radio" value="{xf:value}">
<xsl:copy-of select="@*[not(name()='ref')]"/>
<xsl:if test="xf:value = $selected">
<xsl:attribute name="checked"/>
</xsl:if>
</input>
<xsl:value-of select="xf:caption"/>
<br/>
</xsl:for-each>
</xsl:template>
<xsl:template match="xf:selectMany | xf:selectMany[@selectUIType='listbox']">
<xsl:variable name="selected" select="xf:value"/>
<select name="{@ref}">
<xsl:copy-of select="@*[not(name()='ref')]"/>
<xsl:attribute name="multiple"/>
<xsl:for-each select="xf:item">
<option value="{xf:value}">
<xsl:if test="xf:value = $selected">
<xsl:attribute name="selected"/>
</xsl:if>
<xsl:value-of select="xf:caption"/>
</option>
</xsl:for-each>
</select>
</xsl:template>
<xsl:template match="xf:selectMany[@selectUIType='checkbox']">
<xsl:variable name="selected" select="xf:value"/>
<xsl:variable name="ref" select="@ref"/>
<xsl:for-each select="xf:item">
<input name="{$ref}" type="checkbox" value="{xf:value}">
<xsl:copy-of select="@*[not(name()='ref')]"/>
<xsl:if test="xf:value = $selected">
<xsl:attribute name="checked"/>
</xsl:if>
</input>
<xsl:value-of select="xf:caption"/>
<br/>
</xsl:for-each>
</xsl:template>
<xsl:template match="xf:submit">
<input name="cocoon-action-{@id}" type="submit" value="{xf:caption/text()}">
<xsl:copy-of select="@*[not(name()='id')]"/>
</input>
</xsl:template>
<xsl:template match="*">
<xsl:copy><xsl:copy-of select="@*" /><xsl:apply-templates /></xsl:copy>
</xsl:template>
<xsl:template match="text()">
<xsl:value-of select="." />
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/templates/hello-page.vm
Index: hello-page.vm
===================================================================
<?xml version="1.0"?>
#set($name = $parameters.getParameter("name", ""))
#set($project = $parameters.getParameter("project", ""))
<page>
<title>Hello</title>
<content>
<para>This is my first Cocoon2 page!</para>
<para>Hi! This page is generated using $name from the $project project.</para>
</content>
</page>
1.1 xml-cocoon2/src/webapp/samples/welcome/cocoon.gif
<<Binary file>>
1.1 xml-cocoon2/src/webapp/samples/welcome/status2html.xsl
Index: status2html.xsl
===================================================================
<?xml version="1.0"?>
<!-- Author: Nicola Ken Barozzi "barozzi@nicolaken.com" -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:status="http://apache.org/cocoon/status/2.0">
<xsl:template match="status:statusinfo">
<html>
<head>
<title>Cocoon2 on [
<xsl:value-of select="@status:host" />
]</title>
</head>
<body bgcolor="white">
<table bgcolor="#000000" cellspacing="0" cellpadding="2" width="97%">
<tr>
<td>
<table border="0" bgcolor="#000000" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<table bgcolor="#ffffff" noshade="noshade" cellspacing="0" cellpadding="6" width="100%">
<tr>
<td bgcolor="#0086b2" valign="top" align="left">
<font size="5" face="arial,helvetica,sanserif" color="#ffffff">Apache Cocoon running on
<xsl:value-of select="@status:host" />
</font>
</td>
<td bgcolor="#0086b2" valign="top" align="right">
<font face="arial,helvetica,sanserif" color="#ffffff">
<xsl:value-of select="@status:date" />
</font>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<xsl:call-template name="spacer">
<xsl:with-param name="height" select="number(10)" />
</xsl:call-template>
<xsl:apply-templates />
</body>
</html>
</xsl:template>
<xsl:template match="status:group">
<table border="0" bgcolor="#000000" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<table bgcolor="#000000" border="0" cellspacing="2" cellpadding="6" width="100%">
<tr>
<td bgcolor="#0086b2" valign="top" align="left" colspan="2">
<FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1">-
<xsl:value-of select="@status:name" />
</FONT>
</td>
</tr>
</table>
<table bgcolor="#ffffff" border="0" cellspacing="2" cellpadding="6" width="100%">
<tr>
<td bgcolor="#ffffff">
<table border="0" bgcolor="#000000" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<table width="100%" bgcolor="#000000" border="0" cellspacing="2" cellpadding="6">
<xsl:apply-templates select="status:value" />
<xsl:call-template name="spacer">
<xsl:with-param name="height" select="number(8)" />
</xsl:call-template>
<xsl:apply-templates select="status:group" />
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<xsl:call-template name="spacer">
<xsl:with-param name="height" select="number(6)" />
</xsl:call-template>
</xsl:template>
<xsl:template match="status:value">
<tr>
<td bgcolor="#0086b2" valign="top" align="left" width="1%">
<font face="arial,helvetica,sanserif" color="#ffffff">
<xsl:value-of select="@status:name" />
</font>
</td>
<td bgcolor="#eeeeee" width="100%">
<xsl:choose>
<xsl:when test="../@status:name='memory' and ( @status:name='total' or @status:name='free')">
<font face="arial,helvetica,sanserif">
<xsl:call-template name="suffix">
<xsl:with-param name="bytes" select="number(.)" />
</xsl:call-template>
</font>
</xsl:when>
<xsl:when test="count(status:line) <= 1">
<font face="arial,helvetica,sanserif">
<xsl:value-of select="status:line" />
</font>
</xsl:when>
<xsl:otherwise>
<ul>
<xsl:apply-templates />
</ul>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:template>
<xsl:template match="status:line">
<li>
<font face="arial,helvetica,sanserif">
<xsl:value-of select="." />
</font>
</li>
</xsl:template>
<xsl:template name="suffix">
<xsl:param name="bytes" />
<xsl:choose>
<!-- More than 4 MB (=4194304) -->
<xsl:when test="$bytes >= 4194304">
<xsl:value-of select="round($bytes div 10485.76) div 100" />
MB
<small>(
<xsl:value-of select="$bytes" />
)</small>
</xsl:when>
<!-- More than 4 KB (=4096) -->
<xsl:when test="$bytes > 4096">
<xsl:value-of select="round($bytes div 10.24) div 100" />
KB
<small>(
<xsl:value-of select="$bytes" />
)</small>
</xsl:when>
<!-- Less -->
<xsl:otherwise>
<xsl:value-of select="$bytes" />
B</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="spacer">
<xsl:param name="height" />
<table bgcolor="#ffffff" cellspacing="0" cellpadding="2" width="100%">
<tr>
<td bgcolor="#ffffff">
<table bgcolor="#ffffff" cellspacing="0" cellpadding="2" width="100%">
<tr>
<td width="100%" bgcolor="#ffffff" valign="top" align="left" height="$height">
</td>
</tr>
</table>
</td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>
1.1 xml-cocoon2/src/webapp/samples/welcome/welcome.xhtml
Index: welcome.xhtml
===================================================================
<html xmlns:xlink="http://www.w3.org/1999/xlink">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Apache Cocoon 2.1-dev</title>
<link href="favicon.ico" rel="SHORTCUT ICON" />
</head>
<body alink="#743e75" vlink="#00698c" link="#0086b2" bgcolor="#ffffff">
<table width="60%" align="center" cellpadding="2" cellspacing="2" border="0">
<tbody>
<tr>
<td align="center">
<font color="#000000" face="arial,helvetica,sanserif">The Apache Software Foundation is proud to present...</font>
</td>
</tr>
<tr>
<td align="center" width="40%">
<img src="cocoon.gif" border="0" />
</td>
</tr>
<tr>
<td align="center" width="30%">
<font color="#000000" face="arial,helvetica,sanserif">
<b>version 2.1-dev</b>
</font>
</td>
</tr>
</tbody>
</table>
<p align="center">
</p>
<table width="60%" align="center" cellpadding="2" cellspacing="2" border="0" bgcolor="#000000">
<tbody>
<tr align="center">
<td width="100%" bgcolor="#0086b2">
<font color="#ffffff" face="arial,helvetica,sanserif" size="+1">Welcome!</font>
</td>
</tr>
<tr>
<td align="left" bgcolor="#ffffff" width="100%">
<table align="center" cellpadding="2" cellspacing="0" border="0" bgcolor="#ffffff" width="100%">
<tbody>
<tr>
<td align="left" bgcolor="#ffffff" width="100%">
<font color="#000000" face="arial,helvetica,sanserif" size="+0">It seems you got me running :)
<br />
Here are some links to the relevant portions of the default cocoon webapp.</font>
<br />
<font color="#000000" face="arial,helvetica,sanserif" size="+0">
</font>
</td>
</tr>
<tr>
<td align="left" bgcolor="#ffffff" width="100%">
<font color="#000000" face="arial,helvetica,sanserif" size="+0">
<a href="status">Status</a>
- How is life going on here in my server world? Find out :)</font>
</td>
</tr>
<tr>
<td align="left" bgcolor="#ffffff" width="100%">
<font color="#000000" face="arial,helvetica,sanserif" size="+0">
<a href="documents/index">Documentation</a>
- Who am <a href="http://xml.apache.org/cocoon/">I</a>?
<a href="documents/index">Information</a>,
<a href="tutorial/home.html">tutorials</a> and
<a href="documents/doclist.html">references</a> about me
<a href="documents/index">are here</a>
(<a href="samples/linkstatus/">check links</a>).</font>
</td>
</tr>
<tr>
<td align="left" bgcolor="#ffffff" width="100%">
<font color="#000000" face="arial,helvetica,sanserif" size="+0">
<a href="samples/search/welcome">Search</a>
- Need to <a href="samples/search/welcome">search</a> for a specific
thing about me? Let me do the work for you.</font>
</td>
</tr>
<tr>
<td align="left" bgcolor="#ffffff" width="100%">
<font color="#000000" face="arial,helvetica,sanserif" size="+0">
<a href="samples/welcome">Samples</a>
- Are you being served?</font>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p align="center">
<br />
<font size="-1">Copyright © 1999-2002
<a href="http://www.apache.org/">The Apache Software Foundation</a>
.
<br />
All rights reserved.</font>
</p>
</body>
</html>
----------------------------------------------------------------------
In case of troubles, e-mail: webmaster@xml.apache.org
To unsubscribe, e-mail: cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org