Author: cziegeler Date: Mon Mar 21 02:17:23 2005 New Revision: 158439 URL: http://svn.apache.org/viewcvs?view=rev&rev=158439 Log: Fix html sample by replacing google news with our own news
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/html/samples/stylesheets/apache.xsl (with props) Removed: cocoon/branches/BRANCH_2_1_X/src/blocks/html/samples/stylesheets/googlenews.xsl Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/html/samples/samples.xml cocoon/branches/BRANCH_2_1_X/src/blocks/html/samples/sitemap.xmap Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/html/samples/samples.xml URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/html/samples/samples.xml?view=diff&r1=158438&r2=158439 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/html/samples/samples.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/html/samples/samples.xml Mon Mar 21 02:17:23 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/branches/BRANCH_2_1_X/src/blocks/html/samples/sitemap.xmap URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/html/samples/sitemap.xmap?view=diff&r1=158438&r2=158439 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/html/samples/sitemap.xmap (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/html/samples/sitemap.xmap Mon Mar 21 02:17:23 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/branches/BRANCH_2_1_X/src/blocks/html/samples/stylesheets/apache.xsl URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/html/samples/stylesheets/apache.xsl?view=auto&rev=158439 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/html/samples/stylesheets/apache.xsl (added) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/html/samples/stylesheets/apache.xsl Mon Mar 21 02:17:23 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:[EMAIL PROTECTED]'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/[EMAIL PROTECTED]" title="[EMAIL PROTECTED]"> + <xsl:value-of select="text()"/> + </a> +</xsl:template> + +</xsl:stylesheet> \ No newline at end of file Propchange: cocoon/branches/BRANCH_2_1_X/src/blocks/html/samples/stylesheets/apache.xsl ------------------------------------------------------------------------------ svn:eol-style = native Propchange: cocoon/branches/BRANCH_2_1_X/src/blocks/html/samples/stylesheets/apache.xsl ------------------------------------------------------------------------------ svn:keywords = Id