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 2005/03/21 11:20:54 UTC
svn commit: r158440 - cocoon/blocks/supported/html/trunk/samples/samples.xml
cocoon/blocks/supported/html/trunk/samples/sitemap.xmap
cocoon/blocks/supported/html/trunk/samples/stylesheets/apache.xsl
cocoon/blocks/supported/html/trunk/samples/stylesheets/googlenews.xsl
Author: cziegeler
Date: Mon Mar 21 02:20:53 2005
New Revision: 158440
URL: http://svn.apache.org/viewcvs?view=rev&rev=158440
Log:
Fix html sample by replacing google news with our own news
Added:
cocoon/blocks/supported/html/trunk/samples/stylesheets/apache.xsl (with props)
Removed:
cocoon/blocks/supported/html/trunk/samples/stylesheets/googlenews.xsl
Modified:
cocoon/blocks/supported/html/trunk/samples/samples.xml
cocoon/blocks/supported/html/trunk/samples/sitemap.xmap
Modified: cocoon/blocks/supported/html/trunk/samples/samples.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/supported/html/trunk/samples/samples.xml?view=diff&r1=158439&r2=158440
==============================================================================
--- cocoon/blocks/supported/html/trunk/samples/samples.xml (original)
+++ cocoon/blocks/supported/html/trunk/samples/samples.xml Mon Mar 21 02:20:53 2005
@@ -15,7 +15,7 @@
limitations under the License.
-->
-<!-- CVS $Id: samples.xml,v 1.5 2004/04/05 12:25:33 antonio Exp $ -->
+<!-- CVS $Id$ -->
<samples name="HTML Block Samples" xmlns:xlink="http://www.w3.org/1999/xlink">
@@ -25,7 +25,7 @@
</group>
<group name="HTMLGenerator">
- <sample name="Google News Sci/Tech" href="googlenews">
+ <sample name="Cocoon News Website" href="apache">
Shows how to get remote resource and convert it to valid XHTML using HTMLGenerator.
</sample>
</group>
Modified: cocoon/blocks/supported/html/trunk/samples/sitemap.xmap
URL: http://svn.apache.org/viewcvs/cocoon/blocks/supported/html/trunk/samples/sitemap.xmap?view=diff&r1=158439&r2=158440
==============================================================================
--- cocoon/blocks/supported/html/trunk/samples/sitemap.xmap (original)
+++ cocoon/blocks/supported/html/trunk/samples/sitemap.xmap Mon Mar 21 02:20:53 2005
@@ -17,7 +17,7 @@
<!--+
| HTML block samples sitemap
- | CVS $Id: sitemap.xmap,v 1.5 2004/03/06 02:25:56 antonio Exp $
+ | CVS $Id$
+-->
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
@@ -59,11 +59,11 @@
<!-- ================ TIDY =========================== -->
- <map:match pattern="googlenews">
- <map:generate type="html" src="http://news.google.com/news/en/us/technology.html">
+ <map:match pattern="apache">
+ <map:generate type="html" src="http://cocoon.apache.org/news">
<map:parameter name="xpath" value="/html"/>
</map:generate>
- <map:transform src="stylesheets/googlenews.xsl"/>
+ <map:transform src="stylesheets/apache.xsl"/>
<map:serialize type="xhtml"/>
</map:match>
Added: cocoon/blocks/supported/html/trunk/samples/stylesheets/apache.xsl
URL: http://svn.apache.org/viewcvs/cocoon/blocks/supported/html/trunk/samples/stylesheets/apache.xsl?view=auto&rev=158440
==============================================================================
--- cocoon/blocks/supported/html/trunk/samples/stylesheets/apache.xsl (added)
+++ cocoon/blocks/supported/html/trunk/samples/stylesheets/apache.xsl Mon Mar 21 02:20:53 2005
@@ -0,0 +1,50 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xhtml="http://www.w3.org/1999/xhtml">
+
+<xsl:template match="/xhtml:html">
+ <html>
+ <head>
+ <title><xsl:value-of select="xhtml:head/xhtml:title"/></title>
+ </head>
+ <body>
+ <h2><xsl:value-of select="xhtml:head/xhtml:title"/></h2>
+ <ul>
+ <xsl:apply-templates select="//xhtml:div[@class='content']/xhtml:ul"/>
+ </ul>
+ </body>
+ </html>
+</xsl:template>
+
+<xsl:template match="xhtml:ul">
+ <ul>
+ <xsl:apply-templates select="xhtml:li"/>
+ </ul>
+</xsl:template>
+
+<xsl:template match="xhtml:li">
+ <li><xsl:apply-templates/></li>
+</xsl:template>
+
+<xsl:template match="xhtml:a">
+ <a href="http://cocoon.apache.org/news/{@href}" title="{@title}">
+ <xsl:value-of select="text()"/>
+ </a>
+</xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file
Propchange: cocoon/blocks/supported/html/trunk/samples/stylesheets/apache.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/supported/html/trunk/samples/stylesheets/apache.xsl
------------------------------------------------------------------------------
svn:keywords = Id