You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Robert Douglass <r....@onlinehome.de> on 2003/03/16 09:45:15 UTC

SOLUTION: double namespace attribute in SQL Transformer

Here is the solution that I believe Charles was suggesting (for those who
are as XML inept as I, it is nice to have this in black and white)

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sql="http://apache.org/cocoon/SQL/2.0">


<xsl:template match="/">

  <root>

  <sql:execute-query>
   <sql:query>
        SELECT * FROM foo
   </sql:query>
  </sql:execute-query>

  </root>


</xsl:template>

</xsl:stylesheet>

----------------------------------------------------------------------
   Don't know why, exactly, but this has been discussed here before and
the work around is to use namespace prefixes on all elements, ie don't
use a default namespace in the document with the query.  Something along
those lines anyway.  This works for me.

Charles

Robert Douglass wrote:

>Does anyone know why my sql transformation returns an element with two
xmlns
>attributes?
>
><rowset xmlns="http://apache.org/cocoon/SQL/2.0"
>xmlns="http://apache.org/cocoon/SQL/2.0">
>
>Using cocoon-2.0.4-bm14
>
><map:pipeline>
><map:match pattern="browse">
><map:generate src="Rob/browse/browse.xml"/>
><map:transform src="Rob/browse/browse.xslt">
><map:parameter name="use-request-parameters" value="true"/>
></map:transform>
><map:transform src="" type="sql">
><map:parameter name="use-connection" value="sites"/>
></map:transform>
><map:serialize/>
></map:match>
></map:pipeline>
>
>The xml going into the sql transformation looks like this:
><execute-query xmlns="http://apache.org/cocoon/SQL/2.0">
><query>select type from all_documents where id='4711'</query>
></execute-query>
>
>Thanks,
>
>Robert Douglass
>


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