Writing XML to MySql

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

Writing XML to MySql

assafn
Hi,

I am trying to write part of an XML document to a record (Mysql). When using the following, the DB field is populated with the text of the XML without the XML itself (e.g. no <record> .... </record>):

<sql:update>insert into table (xxx) values (  <sql:param type="xs:string" select="/*"/>)</sql:update>

When trying to change it to (as stated in the documentation):

<sql:update>insert into table (xxx) values (  <sql:param type="oxf:xmlFragment" select="/*"/>)</sql:update>

I get the following exception. Any ideas on how to fix? I am running Tomcat 5.0.30 with mysql 4.1.14-nt and MyISAM tables.

Unsupported parameter type: 1

org.orbeon.oxf.processor.sql.interpreters.QueryInterpreter end QueryInterpreter.java 572
org.orbeon.oxf.processor.sql.SQLProcessor$InterpreterContentHandler endElement SQLProcessor.java 542
org.orbeon.oxf.processor.sql.SQLProcessor$ForwardingContentHandler endElement SQLProcessor.java 634
org.orbeon.oxf.processor.sql.SQLProcessor$InterpreterContentHandler endElement SQLProcessor.java 544
org.orbeon.oxf.processor.sql.SQLProcessor$ForwardingContentHandler endElement SQLProcessor.java 634
org.orbeon.oxf.processor.sql.SQLProcessor$InterpreterContentHandler endElement SQLProcessor.java 544
org.orbeon.oxf.processor.sql.SQLProcessor$ForwardingContentHandler endElement SQLProcessor.java 634
org.orbeon.oxf.processor.sql.SQLProcessor$InterpreterContentHandler endElement SQLProcessor.java 544
org.orbeon.oxf.processor.sql.SQLProcessor$RootInterpreter endElement SQLProcessor.java 304
org.orbeon.oxf.xml.SAXStore replay SAXStore.java 170




--
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: Writing XML to MySql

Erik Bruchez
Administrator
Assaf,

The stack trace below suggests that the oxf:xmlFragment type was not
recognized by the SQL processor. Have you mapped the "oxf" prefix to
"http://orbeon.org/oxf/xml/datatypes"? If not, try doing that first.

If that still doesn't work, can you send a simple XPL example that we
could use for reproducing the issue?

-Erik

[hidden email] wrote:

> Hi,
>
> I am trying to write part of an XML document to a record (Mysql). When using the following, the DB field is populated with the text of the XML without the XML itself (e.g. no <record> .... </record>):
>
> <sql:update>insert into table (xxx) values (  <sql:param type="xs:string" select="/*"/>)</sql:update>
>
> When trying to change it to (as stated in the documentation):
>
> <sql:update>insert into table (xxx) values (  <sql:param type="oxf:xmlFragment" select="/*"/>)</sql:update>
>
> I get the following exception. Any ideas on how to fix? I am running Tomcat 5.0.30 with mysql 4.1.14-nt and MyISAM tables.
>
> Unsupported parameter type: 1
>
> org.orbeon.oxf.processor.sql.interpreters.QueryInterpreter end QueryInterpreter.java 572
> org.orbeon.oxf.processor.sql.SQLProcessor$InterpreterContentHandler endElement SQLProcessor.java 542
> org.orbeon.oxf.processor.sql.SQLProcessor$ForwardingContentHandler endElement SQLProcessor.java 634
> org.orbeon.oxf.processor.sql.SQLProcessor$InterpreterContentHandler endElement SQLProcessor.java 544
> org.orbeon.oxf.processor.sql.SQLProcessor$ForwardingContentHandler endElement SQLProcessor.java 634
> org.orbeon.oxf.processor.sql.SQLProcessor$InterpreterContentHandler endElement SQLProcessor.java 544
> org.orbeon.oxf.processor.sql.SQLProcessor$ForwardingContentHandler endElement SQLProcessor.java 634
> org.orbeon.oxf.processor.sql.SQLProcessor$InterpreterContentHandler endElement SQLProcessor.java 544
> org.orbeon.oxf.processor.sql.SQLProcessor$RootInterpreter endElement SQLProcessor.java 304
> org.orbeon.oxf.xml.SAXStore replay SAXStore.java 170
--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
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: Writing XML to MySql

assafn
Hi Erik,

Thanks again. Indeed the oxf: was missing. The reason
was that there was another declaration (
xmlns:oxf="http://www.orbeon.com/oxf/processors")
under the same namespace. Since I am not an XML expert
I thought it would include the datatypes. Maybe there
is a way to include the datatypes under the processors
or give it another prefix (not oxf) so it is
simplifies for others.

In any case, my solution was:
<sql:param type="oxf:xmlFragment"
select="/record/RECORDS/*"
xmlns:oxf="http://orbeon.org/oxf/xml/datatypes"/>

Works fine!

Assaf

--- Erik Bruchez <[hidden email]> wrote:

> Assaf,
>
> The stack trace below suggests that the
> oxf:xmlFragment type was not
> recognized by the SQL processor. Have you mapped the
> "oxf" prefix to
> "http://orbeon.org/oxf/xml/datatypes"? If not, try
> doing that first.
>
> If that still doesn't work, can you send a simple
> XPL example that we
> could use for reproducing the issue?
>
> -Erik
>
> [hidden email] wrote:
> > Hi,
> >
> > I am trying to write part of an XML document to a
> record (Mysql). When using the following, the DB
> field is populated with the text of the XML without
> the XML itself (e.g. no <record> .... </record>):
> >
> > <sql:update>insert into table (xxx) values (
> <sql:param type="xs:string"
> select="/*"/>)</sql:update>
> >
> > When trying to change it to (as stated in the
> documentation):
> >
> > <sql:update>insert into table (xxx) values (
> <sql:param type="oxf:xmlFragment"
> select="/*"/>)</sql:update>
> >
> > I get the following exception. Any ideas on how to
> fix? I am running Tomcat 5.0.30 with mysql 4.1.14-nt
> and MyISAM tables.
> >
> > Unsupported parameter type: 1
> >
> >
>
org.orbeon.oxf.processor.sql.interpreters.QueryInterpreter
> end QueryInterpreter.java 572
> >
>
org.orbeon.oxf.processor.sql.SQLProcessor$InterpreterContentHandler
> endElement SQLProcessor.java 542
> >
>
org.orbeon.oxf.processor.sql.SQLProcessor$ForwardingContentHandler
> endElement SQLProcessor.java 634
> >
>
org.orbeon.oxf.processor.sql.SQLProcessor$InterpreterContentHandler
> endElement SQLProcessor.java 544
> >
>
org.orbeon.oxf.processor.sql.SQLProcessor$ForwardingContentHandler
> endElement SQLProcessor.java 634
> >
>
org.orbeon.oxf.processor.sql.SQLProcessor$InterpreterContentHandler
> endElement SQLProcessor.java 544
> >
>
org.orbeon.oxf.processor.sql.SQLProcessor$ForwardingContentHandler
> endElement SQLProcessor.java 634
> >
>
org.orbeon.oxf.processor.sql.SQLProcessor$InterpreterContentHandler
> endElement SQLProcessor.java 544
> >
>
org.orbeon.oxf.processor.sql.SQLProcessor$RootInterpreter

> endElement SQLProcessor.java 304
> > org.orbeon.oxf.xml.SAXStore replay SAXStore.java
> 170
>
> --
> Orbeon - XForms Everywhere:
> http://www.orbeon.com/blog/
>
> >
> --
> 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
>

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.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: Writing XML to MySql

Erik Bruchez
Administrator
Assaf,

You are right. In fact there is no requirement that you use "oxf", you
should be able to use another prefix. But yes, a namespace mapping in
the SQL processor will override a mapping done on a parent element in
the XPL file.

-Erik

Assaf wrote:

> Hi Erik,
>
> Thanks again. Indeed the oxf: was missing. The reason
> was that there was another declaration (
> xmlns:oxf="http://www.orbeon.com/oxf/processors")
> under the same namespace. Since I am not an XML expert
> I thought it would include the datatypes. Maybe there
> is a way to include the datatypes under the processors
> or give it another prefix (not oxf) so it is
> simplifies for others.
>
> In any case, my solution was:
> <sql:param type="oxf:xmlFragment"
> select="/record/RECORDS/*"
> xmlns:oxf="http://orbeon.org/oxf/xml/datatypes"/>
>
> Works fine!
>
> Assaf
>
> --- Erik Bruchez <[hidden email]> wrote:
>
>> Assaf,
>>
>> The stack trace below suggests that the
>> oxf:xmlFragment type was not
>> recognized by the SQL processor. Have you mapped the
>> "oxf" prefix to
>> "http://orbeon.org/oxf/xml/datatypes"? If not, try
>> doing that first.
>>
>> If that still doesn't work, can you send a simple
>> XPL example that we
>> could use for reproducing the issue?
>>
>> -Erik
>>
>> [hidden email] wrote:
>>> Hi,
>>>
>>> I am trying to write part of an XML document to a
>> record (Mysql). When using the following, the DB
>> field is populated with the text of the XML without
>> the XML itself (e.g. no <record> .... </record>):
>>> <sql:update>insert into table (xxx) values (
>> <sql:param type="xs:string"
>> select="/*"/>)</sql:update>
>>> When trying to change it to (as stated in the
>> documentation):
>>> <sql:update>insert into table (xxx) values (
>> <sql:param type="oxf:xmlFragment"
>> select="/*"/>)</sql:update>
>>> I get the following exception. Any ideas on how to
>> fix? I am running Tomcat 5.0.30 with mysql 4.1.14-nt
>> and MyISAM tables.
>>> Unsupported parameter type: 1
>>>
>>>
> org.orbeon.oxf.processor.sql.interpreters.QueryInterpreter
>> end QueryInterpreter.java 572
> org.orbeon.oxf.processor.sql.SQLProcessor$InterpreterContentHandler
>> endElement SQLProcessor.java 542
> org.orbeon.oxf.processor.sql.SQLProcessor$ForwardingContentHandler
>> endElement SQLProcessor.java 634
> org.orbeon.oxf.processor.sql.SQLProcessor$InterpreterContentHandler
>> endElement SQLProcessor.java 544
> org.orbeon.oxf.processor.sql.SQLProcessor$ForwardingContentHandler
>> endElement SQLProcessor.java 634
> org.orbeon.oxf.processor.sql.SQLProcessor$InterpreterContentHandler
>> endElement SQLProcessor.java 544
> org.orbeon.oxf.processor.sql.SQLProcessor$ForwardingContentHandler
>> endElement SQLProcessor.java 634
> org.orbeon.oxf.processor.sql.SQLProcessor$InterpreterContentHandler
>> endElement SQLProcessor.java 544
> org.orbeon.oxf.processor.sql.SQLProcessor$RootInterpreter
>> endElement SQLProcessor.java 304
>>> org.orbeon.oxf.xml.SAXStore replay SAXStore.java
>> 170
>>
>> --
>> Orbeon - XForms Everywhere:
>> http://www.orbeon.com/blog/
>>
>> --
>> 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
>>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.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

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
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