|
| |
"Spread Your Wings with Cocoon"
Vol. 7, Issue 6, p. 40
Listing 1
<?xml version="1.0"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<title>A Message From Cocoon</title>
</head>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="message">
<h1><xsl:value-of select="@text"/></h1>
</xsl:template>
</xsl:stylesheet>
Listing 2
<map:components>
<map:generators default="file">
<map:generator name="file"
src="org.apache.cocoon.generation.FileGenerator" label="content"/>
</map:generators>
<map:transformers default="xsl">
<map:transformer name="xsl"
src="org.apache.cocoon.transformation.TraxTransformer"/>
</map:transformers>
<map:serializers default="html">
<map:serializer name="html" mime-type="text/html"
src="org.apache.cocoon.serialization.HTMLSerializer"/>
</map:serializers>
<map:matchers default="wildcard">
<map:matcher name="wildcard"
src="org.apache.cocoon.matching.WildcardURIMatcher"/>
</map:matchers>
</map:components>
Listing 3
<?xml version="1.0"?>
<map:sitemap
xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<map:components>
<map:generators default="file">
<map:generator name="file"
src="org.apache.cocoon.generation.FileGenerator" label="content"/>
</map:generators>
<map:transformers default="xsl">
<map:transformer name="xsl"
src="org.apache.cocoon.transformation.TraxTransformer"/>
</map:transformers>
<map:serializers default="html">
<map:serializer name="html" mime-type="text/html"
src="org.apache.cocoon.serialization.HTMLSerializer"/>
</map:serializers>
<map:matchers default="wildcard">
<map:matcher name="wildcard"
src="org.apache.cocoon.matching.WildcardURIMatcher"/>
</map:matchers>
</map:components>
<map:pipelines>
<map:pipeline>
<map:match pattern="HelloWorld.html">
<map:generate src="HelloWorld.xml"/>
<map:transform src="Style.xsl"/>
<map:serialize/>
</map:match>
</map:pipeline>
</map:pipelines>
</map:sitemap>
Listing 4
?xml version="1.0"?>
<page id="gu">
<section>
<row><field id="dsno_display"/></row>
</section>
<section>
<row><field id="gdianame"/></row>
<row><field id="gdianadres1"/></row>
<row><field id="gdianadres2"/></row>
<row><field id="gdiandate"/></row>
<row><field id="gdianfee"/></row>
</section>
</page>
|
|
All Rights Reserved
Copyright © 2004 SYS-CON Media, Inc.
E-mail: info@sys-con.com
Java and Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. SYS-CON Publications, Inc. is independent of Sun Microsystems, Inc.
|