Re: Problem with SQL Transformer[Sol]

2003-02-07 Thread Cedric Claus
Martin Holz wrote:


Cedric Claus [EMAIL PROTECTED] writes:
 

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??
   


Your configuration looks okay.

If something goes wrong in pipeline, but works when copying
the intermediate result, this is almost always a namespace
problem. Namespace handling in SAX is sometimes strange
(its even stranger in DOM). 
The information in the namespace argument and 
the localname argument of the method org.sax.ContentHandler.startElement
should be redundant to the qname argument and calls to ContentHandler.startPrefixMapping.
But if there is a bug somewhere in the pipeline, this might not be the case. The bug 
might be undetected for a long time, because many components including the Serializer
use only a part of the information. The XMLSerialzer has the tendency to silently
correct a mismatch between the qname and the namespace.

Carsten Ziegler fixed a bug in namespace handling of SQLTransformer at 2002/11/14
cocoon 2.0 is older. Maybe you should try a  newer version of cocoon.


Martin


 

It was really a problem with the namespace, I had changed my XSL depends 
on the Namespace and it does well

Thanks vm for your help

this is the modified file :


xsl:for-each select=text
   xsl:value-of select=./
   xsl:if test=following-sibling::sql:rowset
   xsl:apply-templates 
select=following::sql:rowset/sql:row/sql:data/
   /xsl:if




-
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: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]



Problem with SQL Transformer

2003-02-06 Thread Cedric Claus
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
			textMon titre 1/text
		/element
		element position=2 type=paragraphe
			textc'est beau /text
			sql:execute-query xmlns:sql=http://apache.org/cocoon/SQL/2.0;
sql:use-connectiondatabase_connection/sql:use-connection
sql:queryselect 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: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]