SQL processor and XML submission

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

SQL processor and XML submission

Massimiliano Di Dato
My problem is the follow:
I have a sql processor on sql.xpl file. This processor simply connect to a mysql database and perform a select query.
The page flow is the follow:

<page id="home" path-info="/anagrafica/home" view="operazioni-view.xhtml">
 <action when="/employer/action = 'search'">
  <result page="sql" transform="oxf:xslt">
  <query xsl:version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <name>
    <xsl:value-of select="doc('input:action')/employer/name"/>
  </name>
  <surname>
    <xsl:value-of select="doc('input:action')/employer/surname"/>
  </surname>
  <phone>
    <xsl:value-of select="doc('input:action')/employer/phone"/>
  </phone>
  <address>
    <xsl:value-of select="doc('input:action')/employer/address"/>
  </address>
  </query>
  </result>
  </action>
</page>

As you can see i try to submit an xml structure (<query>) to "sql".
As result, in sql processor, the element <sql:param> can't find the value of relative element. As consequence my query always return null value.
I try to replace sql processor with a processor that write the XML submission on a file to see the result. The xml file is correct and contains the aspected value.
If i perform the XML submission from view page of HOME (operazioni-view.xhtml) with POST method i can perform the query with success.
However i want to pass through page-flow to respect the MVC model.
How can i do?



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: SQL processor and XML submission

Alessandro Vernet
Administrator
On 6/15/07, [hidden email] <[hidden email]> wrote:

> My problem is the follow:
> I have a sql processor on sql.xpl file. This processor simply connect to a mysql database and perform a select query.
> The page flow is the follow:
>
> <page id="home" path-info="/anagrafica/home" view="operazioni-view.xhtml">
>  <action when="/employer/action = 'search'">
>   <result page="sql" transform="oxf:xslt">
>   <query xsl:version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>   <name>
>     <xsl:value-of select="doc('input:action')/employer/name"/>
>   </name>
>   <surname>
>     <xsl:value-of select="doc('input:action')/employer/surname"/>
>   </surname>
>   <phone>
>     <xsl:value-of select="doc('input:action')/employer/phone"/>
>   </phone>
>   <address>
>     <xsl:value-of select="doc('input:action')/employer/address"/>
>   </address>
>   </query>
>   </result>
>   </action>
> </page>
>
> As you can see i try to submit an xml structure (<query>) to "sql".
> As result, in sql processor, the element <sql:param> can't find the value of relative element. As consequence my query always return null value.
> I try to replace sql processor with a processor that write the XML submission on a file to see the result. The xml file is correct and contains the aspected value.
> If i perform the XML submission from view page of HOME (operazioni-view.xhtml) with POST method i can perform the query with success.
> However i want to pass through page-flow to respect the MVC model.
Most likely, this is because the default namespace in your page flow
is http://www.orbeon.com/oxf/controller. On the <query> element, try
to add xmlns="".

Alex

--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: SQL processor and XML submission

Massimiliano Di Dato
This are the namespaces
<config  xmlns:oxf="http://www.orbeon.com/oxf/processors"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xu="http://www.xmldb.org/xupdate"
xmlns="http://www.orbeon.com/oxf/controller">

I try to put on query xmlns="" but nothing, i try to cancel xmlns attribute
but nothing.
How can i do?



----- Original Message -----
From: "Alessandro Vernet" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, June 21, 2007 5:11 AM
Subject: Re: [ops-users] SQL processor and XML submission


> On 6/15/07, [hidden email] <[hidden email]> wrote:
>> My problem is the follow:
>> I have a sql processor on sql.xpl file. This processor simply connect to
>> a mysql database and perform a select query.
>> The page flow is the follow:
>>
>> <page id="home" path-info="/anagrafica/home"
>> view="operazioni-view.xhtml">
>>  <action when="/employer/action = 'search'">
>>   <result page="sql" transform="oxf:xslt">
>>   <query xsl:version="2.0"
>> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>>   <name>
>>     <xsl:value-of select="doc('input:action')/employer/name"/>
>>   </name>
>>   <surname>
>>     <xsl:value-of select="doc('input:action')/employer/surname"/>
>>   </surname>
>>   <phone>
>>     <xsl:value-of select="doc('input:action')/employer/phone"/>
>>   </phone>
>>   <address>
>>     <xsl:value-of select="doc('input:action')/employer/address"/>
>>   </address>
>>   </query>
>>   </result>
>>   </action>
>> </page>
>>
>> As you can see i try to submit an xml structure (<query>) to "sql".
>> As result, in sql processor, the element <sql:param> can't find the value
>> of relative element. As consequence my query always return null value.
>> I try to replace sql processor with a processor that write the XML
>> submission on a file to see the result. The xml file is correct and
>> contains the aspected value.
>> If i perform the XML submission from view page of HOME
>> (operazioni-view.xhtml) with POST method i can perform the query with
>> success.
>> However i want to pass through page-flow to respect the MVC model.
>
> Most likely, this is because the default namespace in your page flow
> is http://www.orbeon.com/oxf/controller. On the <query> element, try
> to add xmlns="".
>
> Alex
>
> --
> Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
> http://www.orbeon.com/
>
>

--------------------------------------------------------------------------------


>
> --
> You receive this message as a subscriber of the [hidden email]
> mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: SQL processor and XML submission

Alessandro Vernet
Administrator
On 6/21/07, Massimiliano Di Dato <[hidden email]> wrote:
> I try to put on query xmlns="" but nothing, i try to cancel xmlns attribute
> but nothing.
> How can i do?

Is the XSLT running? Say, are you getting an error if you type an
invalid XPath expression? If the XPath is running, is the input
document what you expected it to be? Try to put somewhere <xsl:copy-of
select="/*"/> and see what gets inserted there.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: SQL processor and XML submission

Rodrigo Ojeda
I had the similar problem few days ago...

Try this: put the xmlns:xsl="http://www.w3.org/1999/XSL/Transform" in
the config element and in the result section add a dummy element with
the version... like this

<config ... xmlns:xsl="http://www.w3.org/1999/XSL/Transform"/>
...
<page...>
  <action...>
    <result ... transform="oxf:xslt">
      <dummy xsl:version="2.0">
        ...
      </dummy>
    </result>
...

That worked for me.

Regards!

On Wed, 2007-06-27 at 18:33 -0700, Alessandro Vernet wrote:

> On 6/21/07, Massimiliano Di Dato <[hidden email]> wrote:
> > I try to put on query xmlns="" but nothing, i try to cancel xmlns attribute
> > but nothing.
> > How can i do?
>
> Is the XSLT running? Say, are you getting an error if you type an
> invalid XPath expression? If the XPath is running, is the input
> document what you expected it to be? Try to put somewhere <xsl:copy-of
> select="/*"/> and see what gets inserted there.
>
> Alex
> plain text document attachment (message-footer.txt)
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Don't try to bend the spoon, that's impossible. Instead, only try to
realize the truth.
-What truth?-
There is no spoon.
-There is no spoon?-
Then you'll see that it's not the spoon that bends, it is only yourself.




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws