You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by bu...@apache.org on 2001/07/03 18:09:04 UTC
[Bug 2437] New: - XSLT broken? Different behaviour from within cocoon as opposed to running xalan from the command line
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2437
*** shadow/2437 Tue Jul 3 09:09:04 2001
--- shadow/2437.tmp.8722 Tue Jul 3 09:09:04 2001
***************
*** 0 ****
--- 1,243 ----
+ +============================================================================+
+ | XSLT broken? Different behaviour from within cocoon as opposed to running |
+ +----------------------------------------------------------------------------+
+ | Bug #: 2437 Product: Cocoon 2 |
+ | Status: NEW Version: 2.1alpha CVS |
+ | Resolution: Platform: PC |
+ | Severity: Normal OS/Version: Linux |
+ | Priority: Other Component: sitemap components |
+ +----------------------------------------------------------------------------+
+ | Assigned To: cocoon-dev@xml.apache.org |
+ | Reported By: mkamp@codamax.com |
+ | CC list: Cc: |
+ +----------------------------------------------------------------------------+
+ | URL: |
+ +============================================================================+
+ | DESCRIPTION |
+ I got a stylesheet which is working alright, when Xalan is called from the
+ command line and when invoked from XSLT-process-mode (emacs).
+
+ When called from cocoon it is acting very strange. All output related to
+ "data" is omitted. I double checked a thousand times, that I am working with
+ the same files, but this is the case. The only difference between this
+ approaches is, that one is called with a static xml file from the command
+ line and the other is a transformer within Cocoon2.
+
+ Again, with cocoon every output related to data is omitted.
+
+ Maybe this could help. The data element and its children are the only
+ elements which are not prefixed?!
+
+ Here is the stylesheet:
+
+ <?xml version="1.0" encoding="ISO-8859-1"?>
+ <xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:cvis="http://www.codamax.com/vis" >
+ <xsl:output indent="yes" method="xml"/>
+
+ <xsl:template match="cvis:report-definitions">
+ <xsl:element name="debug">
+ report-definitions called.
+ </xsl:element>
+ <xsl:apply-templates />
+ </xsl:template>
+
+ <xsl:template match="cvis:report">
+ <xsl:element name="debug">
+ report called.
+ </xsl:element>
+
+ <xsl:element name="html">
+
+ <!-- html document head -->
+
+ <xsl:element name="head">
+ <xsl:element name="title">
+ <xsl:value-of select="cvis:head/cvis:title"/>
+ </xsl:element>
+ </xsl:element>
+
+
+ <!-- html document body -->
+
+ <xsl:element name="body">
+ <!-- title line -->
+ <xsl:element name="h1">
+ <xsl:value-of select="cvis:head/cvis:title"/>
+ </xsl:element>
+
+ <xsl:element name="table">
+ <xsl:element name="tr">
+ <xsl:for-each select="cvis:head/cvis:column">
+ <xsl:element name="td">
+ <xsl:value-of select="."/>
+ </xsl:element> <!-- td -->
+ </xsl:for-each>
+ </xsl:element> <!-- tr -->
+
+
+ <!-- data -->
+ <xsl:apply-templates select="data"/>
+
+ </xsl:element> <!-- table -->
+ </xsl:element> <!-- body -->
+ </xsl:element> <!-- html -->
+ </xsl:template>
+
+
+ <xsl:template match="data">
+ <xsl:element name="debug">
+ data called.
+ </xsl:element>
+ <xsl:apply-templates />
+ </xsl:template>
+
+ <xsl:template match="row|cvis:subtotal-row|cvis:total-row">
+ <xsl:element name="tr">
+ <xsl:apply-templates select="*"/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="row/*">
+ <xsl:element name="td">
+
+ <!-- total row -->
+ <xsl:if test="parent::total-row">
+ <xsl:element name="font">
+ <xsl:attribute name="size">+2</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+
+ <!-- subtotal row -->
+ <xsl:if test="parent::subtotal-row">
+ <xsl:element name="font">
+ <xsl:attribute name="size">+1</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+
+
+ <xsl:value-of select="."/>
+ </xsl:element>
+ </xsl:template>
+ </xsl:stylesheet>
+
+
+ Here is the input:
+
+ <?xml version="1.0" encoding="ISO-8859-1"?>
+ <cvis:report-definitions xmlns:cvis="http://www.codamax.com/vis">
+ <cvis:report name="pf">
+ <cvis:head>
+ <cvis:title>
+ PortfolioValuation
+ </cvis:title>
+ <cvis:column>
+ <cvis:caption>Land
+ </cvis:caption>
+ <cvis:dimension name="countries" attribute="name" grouped="yes"
+ sorting="ascending"/>
+ </cvis:column>
+ <cvis:column>
+ <cvis:caption>Tageswert
+ </cvis:caption>
+ <cvis:dimension name="securities" attribute="value" grouped="no"
+ sorting="ascending"/>
+ </cvis:column>
+ </cvis:head>
+ <data xmlns:sql="http://apache.org/cocoon/SQL/2.0">
+ <row>
+ <c1>AN</c1>
+ <c2>100.0</c2>
+ </row>
+ <row>
+ <c1>AT</c1>
+ <c2>100.0</c2>
+ </row>
+ <row>
+ <c1>AU</c1>
+ <c2>100.0</c2>
+ </row>
+ <row>
+ <c1>BE</c1>
+ <c2>100.0</c2>
+ </row>
+ <row>
+ <c1>CA</c1>
+ <c2>100.0</c2>
+ </row>
+ <row>
+ <c1>DE</c1>
+ <c2>100.0</c2>
+ </row>
+ <row>
+ <c1>DK</c1>
+ <c2>100.0</c2>
+ </row>
+ <row>
+ <c1>ES</c1>
+ <c2>100.0</c2>
+ </row>
+ <row>
+ <c1>FI</c1>
+ <c2>100.0</c2>
+ </row>
+ <row>
+ <c1>FR</c1>
+ <c2>100.0</c2>
+ </row>
+ <row>
+ <c1>GB</c1>
+ <c2>100.0</c2>
+ </row>
+ <row>
+ <c1>GR</c1>
+ <c2>100.0</c2>
+ </row>
+ <row>
+ <c1>IE</c1>
+ <c2>100.0</c2>
+ </row>
+ <row>
+ <c1>IT</c1>
+ <c2>100.0</c2>
+ </row>
+ <row>
+ <c1>JP</c1>
+ <c2>100.0</c2>
+ </row>
+ <row>
+ <c1>KY</c1>
+ <c2>100.0</c2>
+ </row>
+ <row>
+ <c1>LU</c1>
+ <c2>100.0</c2>
+ </row>
+ <row>
+ <c1>NL</c1>
+ <c2>100.0</c2>
+ </row>
+ <row>
+ <c1>NO</c1>
+ <c2>100.0</c2>
+ </row>
+ <row>
+ <c1>PT</c1>
+ <c2>100.0</c2>
+ </row>
+ <row>
+ <c1>SE</c1>
+ <c2>100.0</c2>
+ </row>
+ <row>
+ <c1>US</c1>
+ <c2>100.0</c2>
+ </row>
+ <row>
+ <c1>XX</c1>
+ <c2>100.0</c2>
+ </row>
+ </data>
+ </cvis:report>
+ </cvis:report-definitions>
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org