You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Michel Gutierrez <mi...@gmail.com> on 2007/07/26 09:56:58 UTC

Problem with SQLTransformer

Hi,

There is certainly a stupid reason but i've spend a few hours to make 
the SQLTransformer work without success. Hopefully someone will point me 
out what i'm doing wrong.

I try to use the sql transformation but the xml goes through the 
transformer sheet unchanged, the <sql:xxx> elements are not executed and 
reach the serializer.

The source XML: sql-select-themes.xml
<?xml version="1.0"?>
<page>
	<execute-query xmlns="http://apache.org/cocoon/SQL/v2">
		<query>SELECT nom FROM Theme</query>
	</execute-query>
</page>

The transformer declaration:
<map:transformer logger="sitemap.transformer.sql" name="sql"
	src="org.apache.cocoon.transformation.SQLTransformer"/>

The sitemap pipeline:
	<map:match pattern="themes">
		<map:generate type="file" src="sql-select-themes.xml"/>
		<map:transform type="sql">
			<map:parameter name="use-connection" value="fmshsql"/>
		</map:transform>
		<map:serialize type="xml"/>
	</map:match>

I can see from the log that a SQLTransformer component is being 
instantiated, but it does nothing and i get the exact 
sql-select-themes.xml at the end of the pipeline.

I know my DB setup is ok, as i can access the SQL server using esql in a 
serverpages generator.

Can someone let me know what my mistake is ?

Thanks,
Marie

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


Re: Problem with SQLTransformer

Posted by Tobia Conforto <to...@linux.it>.
warrell harries wrote:
> From the xml snippet it appears that you have missed out the sql:
> prefix

Actually his namespaces seem to be ok, so I'm not sure what the problem
might be... maybe the SQLTransformer code is not prefix-independent?

> > The source XML: sql-select-themes.xml
> > <?xml version="1.0"?>
> > <page>
> >         <execute-query xmlns="http://apache.org/cocoon/SQL/v2">
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >                 <query>SELECT nom FROM Theme</query>
> >         </execute-query>
> > </page>


Tobia

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


Re: Problem with SQLTransformer

Posted by warrell harries <wa...@googlemail.com>.
oooops, thanks for pointing that out, Florian.

Perhaps it's because I have been (who hasn't?) bewildered by the vagaries of
Xalan and namespaces enough times to always use the sql: prefix ;-)


On 26/07/07, Dev at weitling <de...@weitling.net> wrote:
>
>
>
> warrell harries wrote:
> > From the xml snippet it appears that you have missed out the sql: prefix
> >
> > One of those infuriating 'can't see for looking' things perhaps
>
> This shouldn't be a problem 'cause the default namespace for
> execute-query and below  is set correct.
>
> Florian
>
> > On 26/07/07, Michel Gutierrez <mi...@gmail.com> wrote:
> >> There is certainly a stupid reason but i've spend a few hours to make
> >> the SQLTransformer work without success. Hopefully someone will point
> me
> >> out what i'm doing wrong.
> >>
> >> I try to use the sql transformation but the xml goes through the
> >> transformer sheet unchanged, the <sql:xxx> elements are not executed
> and
> >> reach the serializer.
> >>
> >> The source XML: sql-select-themes.xml
> >> <?xml version="1.0"?>
> >> <page>
> >>         <execute-query xmlns="http://apache.org/cocoon/SQL/v2">
> >>                 <query>SELECT nom FROM Theme</query>
> >>         </execute-query>
> >> </page>
> >>
> >> The transformer declaration:
> >> <map:transformer logger="sitemap.transformer.sql" name="sql"
> >>         src="org.apache.cocoon.transformation.SQLTransformer"/>
> >>
> >> The sitemap pipeline:
> >>         <map:match pattern="themes">
> >>                 <map:generate type="file" src="sql-select-themes.xml"/>
> >>                 <map:transform type="sql">
> >>                         <map:parameter name="use-connection"
> >> value="fmshsql"/>
> >>                 </map:transform>
> >>                 <map:serialize type="xml"/>
> >>         </map:match>
> >>
> >> I can see from the log that a SQLTransformer component is being
> >> instantiated, but it does nothing and i get the exact
> >> sql-select-themes.xml at the end of the pipeline.
> >>
> >> I know my DB setup is ok, as i can access the SQL server using esql in
> a
> >> serverpages generator.
> >>
> >> Can someone let me know what my mistake is ?
> >>
> >> Thanks,
> >> Marie
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> >> For additional commands, e-mail: users-help@cocoon.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Re: Problem with SQLTransformer

Posted by Dev at weitling <de...@weitling.net>.

warrell harries wrote:
> From the xml snippet it appears that you have missed out the sql: prefix
>
> One of those infuriating 'can't see for looking' things perhaps

This shouldn't be a problem 'cause the default namespace for
execute-query and below  is set correct.

Florian

> On 26/07/07, Michel Gutierrez <mi...@gmail.com> wrote:
>> There is certainly a stupid reason but i've spend a few hours to make
>> the SQLTransformer work without success. Hopefully someone will point me
>> out what i'm doing wrong.
>>
>> I try to use the sql transformation but the xml goes through the
>> transformer sheet unchanged, the <sql:xxx> elements are not executed and
>> reach the serializer.
>>
>> The source XML: sql-select-themes.xml
>> <?xml version="1.0"?>
>> <page>
>>         <execute-query xmlns="http://apache.org/cocoon/SQL/v2">
>>                 <query>SELECT nom FROM Theme</query>
>>         </execute-query>
>> </page>
>>
>> The transformer declaration:
>> <map:transformer logger="sitemap.transformer.sql" name="sql"
>>         src="org.apache.cocoon.transformation.SQLTransformer"/>
>>
>> The sitemap pipeline:
>>         <map:match pattern="themes">
>>                 <map:generate type="file" src="sql-select-themes.xml"/>
>>                 <map:transform type="sql">
>>                         <map:parameter name="use-connection"
>> value="fmshsql"/>
>>                 </map:transform>
>>                 <map:serialize type="xml"/>
>>         </map:match>
>>
>> I can see from the log that a SQLTransformer component is being
>> instantiated, but it does nothing and i get the exact
>> sql-select-themes.xml at the end of the pipeline.
>>
>> I know my DB setup is ok, as i can access the SQL server using esql in a
>> serverpages generator.
>>
>> Can someone let me know what my mistake is ?
>>
>> Thanks,
>> Marie
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>

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


Re: Problem with SQLTransformer

Posted by warrell harries <wa...@googlemail.com>.
>From the xml snippet it appears that you have missed out the sql: prefix

One of those infuriating 'can't see for looking' things perhaps

On 26/07/07, Michel Gutierrez <mi...@gmail.com> wrote:
>
> Hi,
>
> There is certainly a stupid reason but i've spend a few hours to make
> the SQLTransformer work without success. Hopefully someone will point me
> out what i'm doing wrong.
>
> I try to use the sql transformation but the xml goes through the
> transformer sheet unchanged, the <sql:xxx> elements are not executed and
> reach the serializer.
>
> The source XML: sql-select-themes.xml
> <?xml version="1.0"?>
> <page>
>         <execute-query xmlns="http://apache.org/cocoon/SQL/v2">
>                 <query>SELECT nom FROM Theme</query>
>         </execute-query>
> </page>
>
> The transformer declaration:
> <map:transformer logger="sitemap.transformer.sql" name="sql"
>         src="org.apache.cocoon.transformation.SQLTransformer"/>
>
> The sitemap pipeline:
>         <map:match pattern="themes">
>                 <map:generate type="file" src="sql-select-themes.xml"/>
>                 <map:transform type="sql">
>                         <map:parameter name="use-connection"
> value="fmshsql"/>
>                 </map:transform>
>                 <map:serialize type="xml"/>
>         </map:match>
>
> I can see from the log that a SQLTransformer component is being
> instantiated, but it does nothing and i get the exact
> sql-select-themes.xml at the end of the pipeline.
>
> I know my DB setup is ok, as i can access the SQL server using esql in a
> serverpages generator.
>
> Can someone let me know what my mistake is ?
>
> Thanks,
> Marie
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Re: Problem with SQLTransformer

Posted by Michel Gutierrez <mi...@gmail.com>.
Many thanks to all with a special mention to Niels. The issue was indeed 
the namespace:

"http://apache.org/cocoon/SQL/2.0" is to be used with SQL transformer, 
while "http://apache.org/cocoon/SQL/v2" is for ESQL server pages.

This kind of stupid issue might be so hard to locate, but i knew the 
Cocoon community will help.

Thanks again !

Niels van Kampenhout wrote:
>> <?xml version="1.0"?>
>> <page>
>>     <execute-query xmlns="http://apache.org/cocoon/SQL/v2">
>>         <query>SELECT nom FROM Theme</query>
>>     </execute-query>
>> </page>
> 
> I think the namespace is incorrect, according to [1] it should be 
> "http://apache.org/cocoon/SQL/2.0", not "http://apache.org/cocoon/SQL/v2".
> 
> Niels
> 
> [1] http://cocoon.apache.org/2.1/userdocs/sql-transformer.html


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


Re: Problem with SQLTransformer

Posted by Niels van Kampenhout <n....@hippo.nl>.
Michel Gutierrez wrote:
> There is certainly a stupid reason but i've spend a few hours to make 
> the SQLTransformer work without success. Hopefully someone will point me 
> out what i'm doing wrong.
> 
> I try to use the sql transformation but the xml goes through the 
> transformer sheet unchanged, the <sql:xxx> elements are not executed and 
> reach the serializer.
> 
> The source XML: sql-select-themes.xml
> <?xml version="1.0"?>
> <page>
>     <execute-query xmlns="http://apache.org/cocoon/SQL/v2">
>         <query>SELECT nom FROM Theme</query>
>     </execute-query>
> </page>

I think the namespace is incorrect, according to [1] it should be 
"http://apache.org/cocoon/SQL/2.0", not "http://apache.org/cocoon/SQL/v2".

Hope this helps,

Niels

[1] http://cocoon.apache.org/2.1/userdocs/sql-transformer.html




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