cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cedric Claus <cedric.cl...@u-mangate.com>
Subject Problem with SQL Transformer
Date Thu, 06 Feb 2003 15:53:46 GMT
Hi,

I have a problem with a pipeline :

<map:match pattern="AOS/page1.html">
	<map:generate src="xml/page1.xml"/>
	<map:transform type="sql"/>
	<map:transform type="xslt" src="xsl/SortAndReplace.xsl"/>
	<map:transform type="xslt" src="xsl/HAbstract.xsl"/>
	<map:serialize/>
</map:match>

This pipeline doesn't work : After SQL transformation the sort and 
replace.xsl does wrong. But if I copy the xml result of the SQL 
transform and then apply the same xsl , no problem!!!! (with xalan and 
MSXML)


My configuration : cocoon 2.0  - tomcat 4.0.5 - JDK 1.4.03 et xalan 2.3.1

What 's wrong??? Is it in configuration??

thx for response

Ced

page1.xml:

<document>
	<elements>
		<element position="1" type="title">
			<text>Mon titre 1</text>
		</element>
		<element position="2" type="paragraphe">
			<text>c'est beau </text>
			<sql:execute-query xmlns:sql="http://apache.org/cocoon/SQL/2.0">
				<sql:use-connection>database_connection</sql:use-connection>
				<sql:query>select data from DataRessources where ( ID_fk_dataDesc=1 
and ID_fk_dataLangue=1 )</sql:query>
			</sql:execute-query>
		</element>
	</elements>
</document>
_______________________________________________________________________

SortAndReplace.xsl:

<xsl:template match="/">
	<document>
		<elements>
			<xsl:apply-templates select="document/elements"/>
		</elements>
	</document>
	
</xsl:template>


<xsl:template match="document/elements">
	
	<xsl:for-each select="element">
	<xsl:sort  select="@position"/>
		<element>
			<xsl:attribute name="type">
				<xsl:value-of select="@type"/>
			</xsl:attribute>
			<xsl:attribute name="position">
				<xsl:value-of select="@position"/>
			</xsl:attribute>
			<xsl:for-each select="text">
					<xsl:value-of select="."/>
					<xsl:if test="following-sibling::rowset">
						<xsl:apply-templates select="following::rowset/row/data"/>
					</xsl:if>
				
			</xsl:for-each>
		</element>
	
	</xsl:for-each>
</xsl:template>

<xsl:template match="rowset/row/data">
	<xsl:value-of select="."/>
</xsl:template>
</xsl:stylesheet>
____________________________________________________________________________



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message