cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SunnyDay <sunny...@rainyday.de>
Subject Re: [C2] Bug in SQL transformer?
Date Tue, 22 Jan 2002 22:17:47 GMT
Tja Luca,

it's all there! And now?  Sorry, I have to leave ...

CU tomorrow
   Harald

 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<?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:import href="page/simple-page2html.xsl"/>

   <xsl:template match="sql:rowset">
    <xsl:choose>
     <xsl:when test="ancestor::sql:rowset">
      <tr>
       <td>
        <table border="1">
         <xsl:apply-templates/>
        </table>
       </td>
      </tr>
     </xsl:when>
     <xsl:otherwise>
      <table border="1">
       <xsl:apply-templates/>
      </table>
     </xsl:otherwise>
    </xsl:choose>
   </xsl:template>

   <xsl:template match="sql:row">
    <tr>
     <xsl:apply-templates/>
    </tr>
   </xsl:template>

   <xsl:template match="sql:name">
    <td><xsl:value-of select="."/></td>
   </xsl:template>

   <xsl:template match="sql:id">
    <!-- ignore -->
   </xsl:template>

</xsl:stylesheet>

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Luca Morandini wrote:

> Harald,
> 
> just a random thought... have you put all due namespaces in your XSLs ?
> 
> I mean, when I want to extract data from the result of an SQLTransformer
> transformation I must use:
> 
> <xsl:template match="sql:row"> instead of <xsl:template match="row">
> and I must declare xmlns:sql="http://apache.org/cocoon/SQL/2.0" at the top
> if the XSL.
> 
> The namespaces were not always needed in Cocoon 2.0rc1 and rc2, but they are
> needed in 2.0, hence... maybe... the simple.sql2html.xsl has not been
> properly updated...
> 
> Best regards,
> 
> ---------------------------------------------
>                Luca Morandini
>                GIS Consultant
>               lmorandini@ieee.org
> http://utenti.tripod.it/lmorandini/index.html
> ---------------------------------------------
> 
> 
> 
>>-----Original Message-----
>>From: SunnyDay [mailto:sunnyday@rainyday.de]
>>Sent: Tuesday, January 22, 2002 10:39 PM
>>To: cocoon-users@xml.apache.org
>>Subject: Re: [C2] Bug in SQL transformer?
>>
>>
>>Hi Luca,
>>
>>
>>>well, I think the case is clearly a sitemap one. For some
>>>
>>reasons the poor
>>
>>
>>That's what I thought, but:
>>
>>    <map:match pattern="sql/*">
>>     <map:generate src="docs/samples/sql/{1}.xml"/>
>>     <map:transform type="sql">
>>       <map:parameter name="use-connection" value="webadmin"/>
>>         <!--
>>            Let's have a look at the user docs:
>>
>>            "[...] The purpose of the SQLTransformer is to query a
>>         database and translate the result to XML. [...]"
>>         -->
>>     </map:transform>
>>     <map:transform src="stylesheets/simple-sql2html.xsl"/>
>>     <map:serialize/>
>>    </map:match>
>>
>>That's the sitemap-part. It's the original one from the cocoon
>>distribution.
>>
>>
>>
>>>Cocoon can't find sql-page.xml, nothing to do with SQLTransformer.
>>>
>>
>>The XML-File does exist in the right place. And now?
>>
>>
>>
>>>BTW, since we use the same DBMS, I enclose an example of an SP
>>>
>>I use, hoping
>>
>>>this helps you.
>>>
>>Your SP looks like mine ;)
>>
>>CU
>>   Harald
>>
>>
>>---------------------------------------------------------------------
>>Please check that your question has not already been answered in the
>>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>>
>>To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
>>For additional commands, e-mail: <cocoon-users-help@xml.apache.org>
>>
> 
> 
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail: <cocoon-users-help@xml.apache.org>
> 
> 



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.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