Hello.
I am new to Orbeon. I am trying to submit an orbeon form to a db2 xml database using the ibm data web services. Orbeon submits the XML as: <?xml version="1.0" encoding="UTF-16" ?> <customers xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"> <customer> <firstname>fsd</firstname> <lastname>dfsd</lastname> <age>12</age> </customer> </customers> while my web services expect it as: <?xml version="1.0" encoding="UTF-16" ?> <customers> <customer> <firstname>fsd</firstname> <lastname>dfsd</lastname> <age>12</age> </customer> </customers> It seems i need to strip the XML name space headers. I have read the tutorials on the site, but i could not find any working examples about processors to achieve the above. I would very much appreciate any help on this matter and the ideal would be if someone could post a small working example of how to call a web service which inserts XML data into a db2 database. Thank you. |
XSLT 2.0 can do this for you - using the xslt processor for example.
For an example take a look at http://www.dpawson.co.uk/xsl/rev2/namespace2.html#d17686e166 The first example there should work for you; ie: <xsl:template match="/"> <xsl:copy-of select="." copy-namespaces="no"/> </xsl:template> Regards Steve -----Original Message----- From: hourani [mailto:[hidden email]] Sent: 06 January 2010 10:36 To: [hidden email] Subject: [ops-users] xml processor / web service db2 Hello. I am new to Orbeon. I am trying to submit an orbeon form to a db2 xml database using the ibm data web services. Orbeon submits the XML as: <?xml version="1.0" encoding="UTF-16" ?> <customers xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"> <customer> <firstname>fsd</firstname> <lastname>dfsd</lastname> <age>12</age> </customer> </customers> while my web services expect it as: <?xml version="1.0" encoding="UTF-16" ?> <customers> <customer> <firstname>fsd</firstname> <lastname>dfsd</lastname> <age>12</age> </customer> </customers> It seems i need to strip the XML name space headers. I have read the tutorials on the site, but i could not find any working examples about processors to achieve the above. I would very much appreciate any help on this matter and the ideal would be if someone could post a small working example of how to call a web service which inserts XML data into a db2 database. Thank you. -- View this message in context: http://n4.nabble.com/xml-processor-web-service-db2-tp999715p999715.html Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.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 OW2 mailing lists service home page: http://www.ow2.org/wws |
Thank you for your swift reply Steve but im sorry it seems i was not clear.
Its not just a part of the processor that i cant get to work. I cant figure out where in the file i should write it either. Should i write the processor in a seperate xpl file? Also is :<xsl:template match="/"> <xsl:copy-of select="." copy-namespaces="no"/> </xsl:template> meant to be written inside the processor or in a style sheet? If it is at all possible i would very much appreciate a simple working example of a processor as it would make understanding how i can implement it simpler. Thank you again.
|
This might help you out -
http://wiki.orbeon.com/forms/how-to/execute-xslt-from-xforms - probably the 2nd option, writing your own xpl pipeline to perform the xslt. The example given includes a sample pipeline that you can use as a basis. Instead of using a separate xslt file you could include it within the pipeline, ie ... <p:input name="config"> <xsl:stylesheet version="2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xsl:template match="/"> <xsl:copy-of select="." copy-namespaces="no"/> </xsl:template> </xsl:stylesheet> </p:input> ... Steve -----Original Message----- From: hourani [mailto:[hidden email]] Sent: 06 January 2010 12:15 To: [hidden email] Subject: [ops-users] RE: xml processor / web service db2 Thank you for your swift reply Steve but im sorry it seems i was not clear. Its not just a part of the processor that i cant get to work. I cant figure out where in the file i should write it either. Should i write the processor in a seperate xpl file? Also is :<xsl:template match="/"> <xsl:copy-of select="." copy-namespaces="no"/> </xsl:template> meant to be written inside the processor or in a style sheet? If it is at all possible i would very much appreciate a simple working example of a processor as it would make understanding how i can implement it simpler. Thank you again. Steve Bayliss wrote: > > XSLT 2.0 can do this for you - using the xslt processor for example. > > For an example take a look at > http://www.dpawson.co.uk/xsl/rev2/namespace2.html#d17686e166 > > The first example there should work for you; ie: > > <xsl:template match="/"> > <xsl:copy-of select="." copy-namespaces="no"/> > </xsl:template> > > Regards > Steve > -- View this message in context: http://n4.nabble.com/xml-processor-web-service-db2-tp999715p999761.html Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.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 OW2 mailing lists service home page: http://www.ow2.org/wws |
Administrator
|
In reply to this post by hourani
Like Steve said, you can run your instance through XSLT before
submitting it. As a (simpler) alternative, you can add the following attribute on your <xforms:instance>: xxforms:exclude-result- prefixes="#all". As you can see, the name and behavior are inspired from XSLT. In essence, it will consider that namespaces that are declared outside of the instance and not explicitly used in the instance are not part of the XML. You'll let us know if this does the trick for you. Alex On Jan 6, 2010, at 2:36 AM, hourani <[hidden email]> wrote: > > Hello. > > I am new to Orbeon. > > I am trying to submit an orbeon form to a db2 xml database using the > ibm > data web services. > > Orbeon submits the XML as: > > <?xml version="1.0" encoding="UTF-16" ?> > <customers xmlns:ev="http://www.w3.org/2001/xml-events" > xmlns:xforms="http://www.w3.org/2002/xforms" > xmlns:xhtml="http://www.w3.org/1999/xhtml" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"> > <customer> > <firstname>fsd</firstname> > <lastname>dfsd</lastname> > <age>12</age> > </customer> > </customers> > > while my web services expect it as: > > <?xml version="1.0" encoding="UTF-16" ?> > <customers> > <customer> > <firstname>fsd</firstname> > <lastname>dfsd</lastname> > <age>12</age> > </customer> > </customers> > > It seems i need to strip the XML name space headers. > > I have read the tutorials on the site, but i could not find any > working > examples about processors to achieve the above. > > I would very much appreciate any help on this matter and the ideal > would be > if someone could post a small working example of how to call a web > service > which inserts XML data into a db2 database. > > > > Thank you. > > > -- > View this message in context: http://n4.nabble.com/xml-processor-web-service-db2-tp999715p999715.html > Sent from the ObjectWeb OPS - Users mailing list archive at > Nabble.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 > OW2 mailing lists service home page: http://www.ow2.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 OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
In reply to this post by hourani
Hello
I've set up a database modelled on Government Forms and now I want to populate it with xml data downloaded from another website. To store the data I have so far managed 1. to download some records by using Form Builder > Services & Actions > HTTP Services with a SOAP Envelope 2. to cut-and-paste the data to Notepad++ 3. to save the data to a file 4. to use the file as input to the HTML to XHTML converter (xforms-tidy) 5. to cut-and-paste that data to Notepad++ 6. to save the data to document-1.xml in the documents folder of my application 7. to use the Import Forms facility of Government Forms to get the file into the database (this only works if I highlight G-325A and there are no forms in G-325A) Were I able to integrate some of these processes, in particular steps 4-7, a lot of time would be saved. Any advice on how to streamline these processes would be much appreciated. Peter Bourdillon -- 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 OW2 mailing lists service home page: http://www.ow2.org/wws |
In reply to this post by Alessandro Vernet
Thank you guys for you continued help.
Alex's method worked to remove the namespaces, but my web services on RAD seem to require that the encoding header be removed also. I'm searching if there is a way around it in RAD's config, but if there's a solution using orbeon i'd much rather not alter my existing web services. Thanks again. <quote author="Alessandro Vernet"> Like Steve said, you can run your instance through XSLT before submitting it. As a (simpler) alternative, you can add the following attribute on your <xforms:instance>: xxforms:exclude-result- prefixes="#all". As you can see, the name and behavior are inspired from XSLT. In essence, it will consider that namespaces that are declared outside of the instance and not explicitly used in the instance are not part of the XML. You'll let us know if this does the trick for you. Alex |
In reply to this post by Peter Bourdillon
Hello
Apologies for carelessly posting this here Peter
|
Administrator
|
In reply to this post by Peter Bourdillon
Peter,
First, let me say the the "Government Forms" can be seen as an early implementation of Form Runner. It is a worth example, but if you are building something new, I' recommend you do it on Form Runner / Form Builder. Now I am confused: you would like to migrate data from Form Builder to the Government Forms example; is that right? Could you elaborate on that? Alex On Jan 7, 2010, at 2:58 AM, Peter Bourdillon <[hidden email]> wrote: > Hello > > I've set up a database modelled on Government Forms and now I want to > populate it with xml data downloaded from another website. > > To store the data I have so far managed > > 1. to download some records by using Form Builder > > Services & Actions > HTTP Services with a SOAP Envelope > > 2. to cut-and-paste the data to Notepad++ > > 3. to save the data to a file > > 4. to use the file as input to the HTML to XHTML converter (xforms- > tidy) > > 5. to cut-and-paste that data to Notepad++ > > 6. to save the data to document-1.xml in the documents folder of my > application > > 7. to use the Import Forms facility of Government Forms to get the > file > into the database (this only works if I highlight G-325A and there are > no forms in G-325A) > > Were I able to integrate some of these processes, in particular steps > 4-7, a lot of time would be saved. Any advice on how to streamline > these > processes would be much appreciated. > > Peter Bourdillon > > > > > > -- > 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 > OW2 mailing lists service home page: http://www.ow2.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 OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Administrator
|
In reply to this post by hourani
I am glad the oxfords:exclude-prefixes worked.
Regarding the encoding header, are you talking about the HTTP header, or the XML declaration (e.g. <?xml version="1.0" encoding="UTF-8" ?>)? Alex On Jan 11, 2010, at 3:00 AM, hourani <[hidden email]> wrote: > > Thank you guys for you continued help. > > Alex's method worked to remove the namespaces, but my web services > on RAD > seem to require that the encoding header be removed also. > > I'm searching if there is a way around it in RAD's config, but if > there's a > solution using orbeon i'd much rather not alter my existing web > services. > > Thanks again. > > > Like Steve said, you can run your instance through XSLT before > submitting it. As a (simpler) alternative, you can add the following > attribute on your <xforms:instance>: xxforms:exclude-result- > prefixes="#all". As you can see, the name and behavior are inspired > from XSLT. In essence, it will consider that namespaces that are > declared outside of the instance and not explicitly used in the > instance are not part of the XML. You'll let us know if this does the > trick for you. > > Alex > > > -- > View this message in context: http://n4.nabble.com/xml-processor-web-service-db2-tp999715p1011150.html > Sent from the ObjectWeb OPS - Users mailing list archive at > Nabble.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 > OW2 mailing lists service home page: http://www.ow2.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 OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
In reply to this post by Alessandro Vernet
Alex
I am downloading from another website 260 items of form data for each of 2700 subjects. I'm not trying collect the data myself from those completing the forms. The purpose is to replace a SQL database that has grown haphazardly over 10 years and which only stores a fraction of the data collected on the forms. Being new to XML I started trying to emulate the data storage in Bookcast but eventually realised Government Forms, especially G-325A, would do much of what I wanted to do: store all the data, display the data, enable searching and PDF production. I then looked for a method to download the XML data and eventually found it in Form Builder > Services & Actions > HTTP Services. I still need to remove the tedious steps of cutting-and-pasting before storing one person's data at a time. I now realise that using PFC should help, but I'm currently stuck at the stage of saving the output of the HTML to XHTML converter (xforms-tidy). Are you recommending I should start again or is it possible to take a form such as G-325A and put it into Form Builder-Form Runner? Peter
|
Administrator
|
Peter,
Unless you are not incredibly pressed by time (i.e. have something that almost works, and need to release soon), I'd look into Form Runner. Note that you can use Form Runner and still write the form "by hand", in an XML editor, like you do now. If you want to build on what you have, the "HTTP Services" in Form Builder just creates an xforms:submission for you. So you should be able to put that submission in your own code. Are you now copying an pasting that xforms:submission from the code generated by Form Builder to your own code? Alex On Jan 12, 2010, at 2:12 PM, Peter Bourdillon <[hidden email]> wrote: > > Alex > > I am downloading from another website 260 items of form data for > each of > 2700 subjects. I'm not trying collect the data myself from those > completing > the forms. The purpose is to replace a SQL database that has grown > haphazardly over 10 years and which only stores a fraction of the data > collected on the forms. > > Being new to XML I started trying to emulate the data storage in > Bookcast > but eventually realised Government Forms, especially G-325A, would > do much > of what I wanted to do: store all the data, display the data, enable > searching and PDF production. > > I then looked for a method to download the XML data and eventually > found it > in Form Builder > Services & Actions > HTTP Services. I still need > to remove > the tedious steps of cutting-and-pasting before storing one person's > data at > a time. I now realise that using PFC should help, but I'm currently > stuck at > the stage of saving the output of the HTML to XHTML converter > (xforms-tidy). > > Are you recommending I should start again or is it possible to take > a form > such as G-325A and put it into Form Builder-Form Runner? > > Peter > > > > > > > Alessandro Vernet wrote: >> >> Peter, >> >> First, let me say the the "Government Forms" can be seen as an early >> implementation of Form Runner. It is a worth example, but if you are >> building something new, I' recommend you do it on Form Runner / Form >> Builder. >> >> Now I am confused: you would like to migrate data from Form Builder >> to >> the Government Forms example; is that right? Could you elaborate on >> that? >> >> Alex >> >> >> >> On Jan 7, 2010, at 2:58 AM, Peter Bourdillon <[hidden email]> >> wrote: >> >>> Hello >>> >>> I've set up a database modelled on Government Forms and now I want >>> to >>> populate it with xml data downloaded from another website. >>> >>> To store the data I have so far managed >>> >>> 1. to download some records by using Form Builder > >>> Services & Actions > HTTP Services with a SOAP Envelope >>> >>> 2. to cut-and-paste the data to Notepad++ >>> >>> 3. to save the data to a file >>> >>> 4. to use the file as input to the HTML to XHTML converter (xforms- >>> tidy) >>> >>> 5. to cut-and-paste that data to Notepad++ >>> >>> 6. to save the data to document-1.xml in the documents folder of my >>> application >>> >>> 7. to use the Import Forms facility of Government Forms to get the >>> file >>> into the database (this only works if I highlight G-325A and there >>> are >>> no forms in G-325A) >>> >>> Were I able to integrate some of these processes, in particular >>> steps >>> 4-7, a lot of time would be saved. Any advice on how to streamline >>> these >>> processes would be much appreciated. >>> >>> Peter Bourdillon >>> >>> >>> >>> >>> >>> -- >>> 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 >>> OW2 mailing lists service home page: http://www.ow2.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 >> OW2 mailing lists service home page: http://www.ow2.org/wws >> >> > > -- > View this message in context: http://n4.nabble.com/xml-processor-web-service-db2-tp999715p1012547.html > Sent from the ObjectWeb OPS - Users mailing list archive at > Nabble.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 > OW2 mailing lists service home page: http://www.ow2.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 OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Alex
No, I'm not incredibly pressed for time. I look forward to your imminent release I've now had a look at the xforms:submission in HTTP Services. It is certainly helping my understanding. Peter |
In reply to this post by Alessandro Vernet
Alex
I'm sorry to say I'm no nearer to storing the XML data that is within the SOAP Envelope. Despite looking at the Form Builder User Guide countless times, I just don't understand how to handle the service response either in Form Builder or in Form Runner. Could there be another example or two in the Form Builder User Guide please? Peter |
Administrator
|
Peter,
Yes, we should definitely expand the Form Builder documentation with some more examples. In a nutshell, you handle the response from web services with a actions. For instance, you can setup an action that sets the value of a control based on a node in the SOAP response. Alex On Mon, Apr 12, 2010 at 9:10 AM, Peter Bourdillon <[hidden email]> wrote: > > Alex > > I'm sorry to say I'm no nearer to storing the XML data that is within the > SOAP Envelope. Despite looking at the Form Builder User Guide countless > times, I just don't understand how to handle the service response either in > Form Builder or in Form Runner. > > Could there be another example or two in the Form Builder User Guide please? > > Peter > > -- > View this message in context: http://n4.nabble.com/xml-processor-web-service-db2-tp999715p1837368.html > Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.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 > OW2 mailing lists service home page: http://www.ow2.org/wws > > -- Orbeon Forms - Web forms, open-source, for the Enterprise - http://www.orbeon.com/ My Twitter: http://twitter.com/avernet -- 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 OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Free forum by Nabble | Edit this page |