You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by bd...@apache.org on 2005/10/22 09:57:50 UTC
svn commit: r327643 - in
/cocoon/branches/BRANCH_2_1_X/src/blocks/tour/samples:
intro/presentation/select-id.xsl pipelines/xsl/html-styling.xsl
pipelines/xsl/news-to-html.xsl pipelines/xsl/request-to-html.xsl
pipelines/xsl/request-to-svg.xsl
Author: bdelacretaz
Date: Sat Oct 22 00:57:42 2005
New Revision: 327643
URL: http://svn.apache.org/viewcvs?rev=327643&view=rev
Log:
tour block was partially broken, need to use @name attribute instead of @id (which is invalid in XSLT) to identify elements in XSL transforms
Modified:
cocoon/branches/BRANCH_2_1_X/src/blocks/tour/samples/intro/presentation/select-id.xsl
cocoon/branches/BRANCH_2_1_X/src/blocks/tour/samples/pipelines/xsl/html-styling.xsl
cocoon/branches/BRANCH_2_1_X/src/blocks/tour/samples/pipelines/xsl/news-to-html.xsl
cocoon/branches/BRANCH_2_1_X/src/blocks/tour/samples/pipelines/xsl/request-to-html.xsl
cocoon/branches/BRANCH_2_1_X/src/blocks/tour/samples/pipelines/xsl/request-to-svg.xsl
Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/tour/samples/intro/presentation/select-id.xsl
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/tour/samples/intro/presentation/select-id.xsl?rev=327643&r1=327642&r2=327643&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/tour/samples/intro/presentation/select-id.xsl (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/tour/samples/intro/presentation/select-id.xsl Sat Oct 22 00:57:42 2005
@@ -16,7 +16,7 @@
limitations under the License.
-->
-<!-- copy an xpath-specified excerpt or our input -->
+<!-- copy an excerpt having specified id or name attribute, tor our output -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
@@ -30,9 +30,9 @@
</xsl:copy>
</xsl:template>
- <!-- apply given xpath on root -->
+ <!-- on root, select elements having specific id or name -->
<xsl:template match="/">
- <xsl:apply-templates select="//*[@id=$idToSelect]"/>
+ <xsl:apply-templates select="//*[@id=$idToSelect or @name=$idToSelect]"/>
</xsl:template>
</xsl:stylesheet>
Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/tour/samples/pipelines/xsl/html-styling.xsl
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/tour/samples/pipelines/xsl/html-styling.xsl?rev=327643&r1=327642&r2=327643&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/tour/samples/pipelines/xsl/html-styling.xsl (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/tour/samples/pipelines/xsl/html-styling.xsl Sat Oct 22 00:57:42 2005
@@ -23,15 +23,15 @@
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
- <xsl:template id="main" match="/">
+ <xsl:template name="main" match="/">
<html>
<head>
<link rel="stylesheet" href="css/tour.css" type="text/css"/>
- <xsl:copy-of select="//head/*"/>
+ <xsl:copy-of select="//head/node()"/>
</head>
<body>
- <xsl:copy-of select="//body/*"/>
+ <xsl:copy-of select="//body/node()"/>
<p class="footer">
This footer has been added by html-styling.xsl
</p>
Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/tour/samples/pipelines/xsl/news-to-html.xsl
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/tour/samples/pipelines/xsl/news-to-html.xsl?rev=327643&r1=327642&r2=327643&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/tour/samples/pipelines/xsl/news-to-html.xsl (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/tour/samples/pipelines/xsl/news-to-html.xsl Sat Oct 22 00:57:42 2005
@@ -25,7 +25,7 @@
xmlns:rss="http://purl.org/rss/1.0/"
>
- <xsl:template id="main" match="/">
+ <xsl:template name="main" match="/">
<html>
<body>
<h1>
@@ -38,7 +38,7 @@
</html>
</xsl:template>
- <xsl:template id="rssItem" match="rss:item">
+ <xsl:template name="rssItem" match="rss:item">
<li>
<a href="{@rdf:about}"><xsl:value-of select="rss:title"/></a>
</li>
Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/tour/samples/pipelines/xsl/request-to-html.xsl
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/tour/samples/pipelines/xsl/request-to-html.xsl?rev=327643&r1=327642&r2=327643&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/tour/samples/pipelines/xsl/request-to-html.xsl (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/tour/samples/pipelines/xsl/request-to-html.xsl Sat Oct 22 00:57:42 2005
@@ -24,15 +24,19 @@
xmlns:h="http://apache.org/cocoon/request/2.0"
>
- <xsl:template id="main" match="/">
+ <xsl:template name="main" match="/">
<html>
<body>
<h1>
Request to host <xsl:value-of select="//h:header[@name='Host']"/>
</h1>
- <p>
- Contains <xsl:value-of select="count(//h:header)"/> headers.
- </p>
+ <h2>
+ Request headers
+ </h2>
+ <xsl:for-each select="//h:header">
+ <b><xsl:value-of select="@name"/></b> : <xsl:value-of select="."/>
+ <br/>
+ </xsl:for-each>
</body>
</html>
</xsl:template>
Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/tour/samples/pipelines/xsl/request-to-svg.xsl
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/tour/samples/pipelines/xsl/request-to-svg.xsl?rev=327643&r1=327642&r2=327643&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/tour/samples/pipelines/xsl/request-to-svg.xsl (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/tour/samples/pipelines/xsl/request-to-svg.xsl Sat Oct 22 00:57:42 2005
@@ -26,7 +26,7 @@
<xsl:param name="fillColor" select="'#330000'"/>
- <xsl:template id="main" match="/">
+ <xsl:template name="main" match="/">
<svg width="600" height="500">
<defs>
<filter id="blur1">