You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Per Kreipke <pe...@onclave.com> on 2000/10/20 00:06:44 UTC

ESQL bug?

> The following simple example:
> 
> <?xml version="1.0"?>
> <?cocoon-format type="text/xml"?>
> <?cocoon-process type="xsp"?>
> <?xml-logicsheet
> href="resource://org/apache/cocoon/processor/xsp/library/sql/esql.xsl"?>
> 
> <xsp:page
>   language="java"
>   xmlns:xsp="http://www.apache.org/1999/XSP/Core"
>   xmlns:esql="http://apache.org/cocoon/SQL/v2"
>   xmlns:testing="http://bogus/uri"
> >
>   <page>Testing
>    	<esql:execute-query inner-method="yes">
> 		<esql:driver>sun.jdbc.odbc.JdbcOdbcDriver</esql:driver>
> 		<esql:dburl>jdbc:odbc:ProjectPlan2</esql:dburl>
> 		<esql:max-rows>20</esql:max-rows>
> 		<esql:query>select * from simple</esql:query>
> 		<esql:results>
> 		 <name><esql:get-string column="Name"/></name>
> 		</esql:results>
> 	</esql:execute-query> 
>   </page>
> </xsp:page>
> 
> creates the following:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <page xmlns:testing="http://bogus/uri">Testing
>     <name xmlns:testing="http://bogus/uri">Configure beta server</name>
>     <name xmlns:testing="http://bogus/uri">COPPA compliance check?</name>
>     <name xmlns:testing="http://bogus/uri">Robot exclusion policy?</name>
> </page>
> 
> Note that each row returned from the database is tagged with a namespace
> tag. I think that's wrong. If not, what is the reason for this?
> 
> I've tried to figure out why and found that the error doesn't occur when
> the 'inner-method' attribute on <esql:execute-query> is "no".
> 
> I've tried to track it further and can only surmise that there is
> something in 'generate-code' in that copies the attributes. However, no
> matter what I comment out, I can't get it to go away. E.g. I can't offer a
> patch.
> 
> Per.

RE: ESQL bug?

Posted by Per Kreipke <pe...@onclave.com>.
Donald,

Comments? Is this how it should be working?

Per

>  -----Original Message-----
> From: 	Per Kreipke [mailto:per@onclave.com] 
> Sent:	Thursday, October 19, 2000 8:25 PM
> To:	cocoon-users@xml.apache.org
> Subject:	RE: ESQL bug?
> 
> Ok, so the bug isn't in the esql taglib, the extra namespace attributes
> are coming from the xsp processor itself, in xsp-java.xsl. The following
> block adds the code that generates the namespace attributes:
> 
>     <!-- Add namespace declarations -->
>     <xsl:for-each select="namespace::*">
>       ((Element) xspCurrentNode).setAttribute(
>         "xmlns:<xsl:value-of select="local-name(.)"/>",
>         "<xsl:value-of select="."/>"
>       );
>     </xsl:for-each>
> 
> I still don't think the objects shown below need namespace declarations on
> each of them. Where are the namespaces that are being copied here coming
> from? 
> 
> Suggestions? Comments?
> 
> Per
> 	 -----Original Message-----
> 	From: 	Per Kreipke [mailto:per@onclave.com] 
> 	Sent:	Thursday, October 19, 2000 6:07 PM
> 	To:	cocoon-users@xml.apache.org
> 	Subject:	ESQL bug?
> 
> 	The following simple example:
> 
> 	<?xml version="1.0"?>
> 	<?cocoon-format type="text/xml"?>
> 	<?cocoon-process type="xsp"?>
> 	<?xml-logicsheet
> href="resource://org/apache/cocoon/processor/xsp/library/sql/esql.xsl"?>
> 
> 	<xsp:page
> 	  language="java"
> 	  xmlns:xsp="http://www.apache.org/1999/XSP/Core"
> 	  xmlns:esql="http://apache.org/cocoon/SQL/v2"
> 	  xmlns:testing="http://bogus/uri"
> 	>
> 	  <page>Testing
> 	   	<esql:execute-query inner-method="yes">
> 	
> <esql:driver>sun.jdbc.odbc.JdbcOdbcDriver</esql:driver>
> 			<esql:dburl>jdbc:odbc:ProjectPlan2</esql:dburl>
> 			<esql:max-rows>20</esql:max-rows>
> 			<esql:query>select * from simple</esql:query>
> 			<esql:results>
> 			 <name><esql:get-string column="Name"/></name>
> 			</esql:results>
> 		</esql:execute-query> 
> 	  </page>
> 	</xsp:page>
> 
> 	creates the following:
> 
> 	<?xml version="1.0" encoding="UTF-8"?>
> 	<page xmlns:testing="http://bogus/uri">Testing
> 	    <name xmlns:testing="http://bogus/uri">Configure beta
> server</name>
> 	    <name xmlns:testing="http://bogus/uri">COPPA compliance
> check?</name>
> 	    <name xmlns:testing="http://bogus/uri">Robot exclusion
> policy?</name>
> 	</page>
> 
> 	Note that each row returned from the database is tagged with a
> namespace tag. I think that's wrong. If not, what is the reason for this?
> 
> 	I've tried to figure out why and found that the error doesn't occur
> when the 'inner-method' attribute on <esql:execute-query> is "no".
> 
> 	I've tried to track it further and can only surmise that there is
> something in 'generate-code' in that copies the attributes. However, no
> matter what I comment out, I can't get it to go away. E.g. I can't offer a
> patch.
> 
> 	Per. << File: ATT00087.txt >>  << File: ATT00097.txt >> 

RE: ESQL bug?

Posted by Per Kreipke <pe...@onclave.com>.
Ok, so the bug isn't in the esql taglib, the extra namespace attributes are
coming from the xsp processor itself, in xsp-java.xsl. The following block
adds the code that generates the namespace attributes:

    <!-- Add namespace declarations -->
    <xsl:for-each select="namespace::*">
      ((Element) xspCurrentNode).setAttribute(
        "xmlns:<xsl:value-of select="local-name(.)"/>",
        "<xsl:value-of select="."/>"
      );
    </xsl:for-each>

I still don't think the objects shown below need namespace declarations on
each of them. Where are the namespaces that are being copied here coming
from? 

Suggestions? Comments?

Per
>  -----Original Message-----
> From: 	Per Kreipke [mailto:per@onclave.com] 
> Sent:	Thursday, October 19, 2000 6:07 PM
> To:	cocoon-users@xml.apache.org
> Subject:	ESQL bug?
> 
> The following simple example:
> 
> <?xml version="1.0"?>
> <?cocoon-format type="text/xml"?>
> <?cocoon-process type="xsp"?>
> <?xml-logicsheet
> href="resource://org/apache/cocoon/processor/xsp/library/sql/esql.xsl"?>
> 
> <xsp:page
>   language="java"
>   xmlns:xsp="http://www.apache.org/1999/XSP/Core"
>   xmlns:esql="http://apache.org/cocoon/SQL/v2"
>   xmlns:testing="http://bogus/uri"
> >
>   <page>Testing
>    	<esql:execute-query inner-method="yes">
> 		<esql:driver>sun.jdbc.odbc.JdbcOdbcDriver</esql:driver>
> 		<esql:dburl>jdbc:odbc:ProjectPlan2</esql:dburl>
> 		<esql:max-rows>20</esql:max-rows>
> 		<esql:query>select * from simple</esql:query>
> 		<esql:results>
> 		 <name><esql:get-string column="Name"/></name>
> 		</esql:results>
> 	</esql:execute-query> 
>   </page>
> </xsp:page>
> 
> creates the following:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <page xmlns:testing="http://bogus/uri">Testing
>     <name xmlns:testing="http://bogus/uri">Configure beta server</name>
>     <name xmlns:testing="http://bogus/uri">COPPA compliance check?</name>
>     <name xmlns:testing="http://bogus/uri">Robot exclusion policy?</name>
> </page>
> 
> Note that each row returned from the database is tagged with a namespace
> tag. I think that's wrong. If not, what is the reason for this?
> 
> I've tried to figure out why and found that the error doesn't occur when
> the 'inner-method' attribute on <esql:execute-query> is "no".
> 
> I've tried to track it further and can only surmise that there is
> something in 'generate-code' in that copies the attributes. However, no
> matter what I comment out, I can't get it to go away. E.g. I can't offer a
> patch.
> 
> Per. << File: ATT00087.txt >>