instance & post data merge

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

instance & post data merge

Colin Seaman
Hi,

I'm trying to merge my XML Post data and my form's normal instance data,
but with no success.  Does anyone have any examples of how to do this?

thanks,

--
Colin Seaman
Senior Developer
 
Tradocs Ltd,
Tower Point,
44 North Road,
Brighton,
BN1 1YR

email:     [hidden email]
skype:     colin,seaman
telephone: 0870-1417031
website:   http://www.tradocs.net

This email and any files transmitted with it are confidential
and intended solely for the use of the individual or entity to
whom they are addressed. If you have received this email in
error please contact Tradocs. Please note that any views or
opinions presented in this email are solely those of the author
and do not necessarily represent those of the company. Finally,
the recipient should check this email and any attachments for
the presence of viruses. The company accepts no liability for
any damage caused by any virus transmitted by this email.
This content of this email is without prejudice.




--
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: instance & post data merge

Erik Bruchez
Administrator
Colin,

> I'm trying to merge my XML Post data and my form's normal instance data,
> but with no success.  Does anyone have any examples of how to do this?

Can you describe more precisely what you want to do?

-Erik

--
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: instance & post data merge

Colin Seaman
yep; I'm using Orbeon specifically for rendering XForms.  From our application I want to be able to post our stored XML data to a specific Xform and have that data populated within the form when it is shown on the screen.

For this to happen my "instance" data used to show and reference the fields in the XForm needs to have the Posted XML's data merged in to it, so that when I view the form I can see all the fields in the instance data, plus any populated ones filled in from the posted XML data.

<supplier>
    <name/>
    <address1/>
    <city/>
</supplier>

With posted data merged, instance would be:

<supplier>
    <name>BOB's Construction</name>
    <address1>
    <city>London</city>
</supplier>

Hope that makes sense!
Colin Seaman
Senior Developer
 
Tradocs Ltd,
Tower Point,
44 North Road,
Brighton,
BN1 1YR

email:     [hidden email]
skype:     colin,seaman
telephone: 0870-1417031
website:   http://www.tradocs.net

This email and any files transmitted with it are confidential 
and intended solely for the use of the individual or entity to 
whom they are addressed. If you have received this email in 
error please contact Tradocs. Please note that any views or 
opinions presented in this email are solely those of the author 
and do not necessarily represent those of the company. Finally, 
the recipient should check this email and any attachments for 
the presence of viruses. The company accepts no liability for 
any damage caused by any virus transmitted by this email.
This content of this email is without prejudice.


Erik Bruchez wrote:
Colin,

I'm trying to merge my XML Post data and my form's normal instance data, but with no success.  Does anyone have any examples of how to do this?

Can you describe more precisely what you want to do?

-Erik


-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: [hidden email] For general help: [hidden email] 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: instance & post data merge

Erik Bruchez
Administrator
Colin,

 > yep; I'm using Orbeon specifically for rendering XForms.  From our
 > application I want to be able to post our stored XML data to a
 > specific Xform and have that data populated within the form when it
 > is shown on the screen.
 >
 > For this to happen my "instance" data used to show and reference the
 > fields in the XForm needs to have the Posted XML's data merged in to it,
 > so that when I view the form I can see all the fields in the instance
 > data, plus any populated ones filled in from the posted XML data.
 >
 > <supplier>
 >     <name/>
 >     <address1/>
 >     <city/>
 > </supplier>
 >
 > With posted data merged, instance would be:
 >
 > <supplier>
 >     <name>BOB's Construction</name>
 >     <address1>
 >     <city>London</city>
 > </supplier>
 >
 > Hope that makes sense!

Partially at least ;-) If somebody posts an XML document to the URL of
your XForms page, the page can retrieve the submitted instance using
XInclude, XSLT, or the xforms:instance/@src attribute, see the
following:

http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-instance-initialization

This means that your XForms instance will actually contain the XML
document submitted to your page.

-Erik

--
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: instance & post data merge

Colin Seaman
thanks, although I still can't manage to get this working.

A HTML page I'm posting from:

anotherserver.com/post.htm
<form method="post" action="myserver_etc/xform/test/">
<textarea name="myxml" rows="10" cols="10"></textarea>
</form>

Are there any examples of the correct coding for the page-flow/XForm that allows me to merge whatever XML data I send with the above form in to my current instance data?

Colin Seaman
Senior Developer
 
Tradocs Ltd,
Tower Point,
44 North Road,
Brighton,
BN1 1YR

email:     [hidden email]
skype:     colin,seaman
telephone: 0870-1417031
website:   http://www.tradocs.net

This email and any files transmitted with it are confidential 
and intended solely for the use of the individual or entity to 
whom they are addressed. If you have received this email in 
error please contact Tradocs. Please note that any views or 
opinions presented in this email are solely those of the author 
and do not necessarily represent those of the company. Finally, 
the recipient should check this email and any attachments for 
the presence of viruses. The company accepts no liability for 
any damage caused by any virus transmitted by this email.
This content of this email is without prejudice.


Erik Bruchez wrote:
Colin,

> yep; I'm using Orbeon specifically for rendering XForms.  From our
> application I want to be able to post our stored XML data to a
> specific Xform and have that data populated within the form when it
> is shown on the screen.
>
> For this to happen my "instance" data used to show and reference the
> fields in the XForm needs to have the Posted XML's data merged in to it,
> so that when I view the form I can see all the fields in the instance
> data, plus any populated ones filled in from the posted XML data.
>
> <supplier>
>     <name/>
>     <address1/>
>     <city/>
> </supplier>
>
> With posted data merged, instance would be:
>
> <supplier>
>     <name>BOB's Construction</name>
>     <address1>
>     <city>London</city>
> </supplier>
>
> Hope that makes sense!

Partially at least ;-) If somebody posts an XML document to the URL of
your XForms page, the page can retrieve the submitted instance using
XInclude, XSLT, or the xforms:instance/@src attribute, see the
following:

http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-instance-initialization

This means that your XForms instance will actually contain the XML
document submitted to your page.

-Erik


-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: [hidden email] For general help: [hidden email] 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: instance & post data merge

Alessandro  Vernet
Administrator
Hi Colin,

If you are posting an XML document to the URL of your XForms page,
then you can directly use XInclude, as Erik said earlier.

If you are posting name/value pairs, for instance with an HTML form,
you first need to convert those name/value pairs in an XML document.
You can do this in your PFC with <setvalue>:

http://www.orbeon.com/ops/doc/reference-page-flow#url-extraction

Alex

On 11/15/06, Colin Seaman <[hidden email]> wrote:

>
>  thanks, although I still can't manage to get this working.
>
>  A HTML page I'm posting from:
>
>  anotherserver.com/post.htm
>  <form method="post" action="myserver_etc/xform/test/">
>  <textarea name="myxml" rows="10" cols="10"></textarea>
>  </form>
>
>  Are there any examples of the correct coding for the page-flow/XForm that
> allows me to merge whatever XML data I send with the above form in to my
> current instance data?
>
>  Colin Seaman
> Senior Developer
>
> Tradocs Ltd,
> Tower Point,
> 44 North Road,
> Brighton,
> BN1 1YR
>
> email: [hidden email]
> skype: colin,seaman
> telephone: 0870-1417031
> website: http://www.tradocs.net
>
> This email and any files transmitted with it are confidential
> and intended solely for the use of the individual or entity to
> whom they are addressed. If you have received this email in
> error please contact Tradocs. Please note that any views or
> opinions presented in this email are solely those of the author
> and do not necessarily represent those of the company. Finally,
> the recipient should check this email and any attachments for
> the presence of viruses. The company accepts no liability for
> any damage caused by any virus transmitted by this email.
> This content of this email is without prejudice.
>
>
>  Erik Bruchez wrote:
> Colin,
>
>  > yep; I'm using Orbeon specifically for rendering XForms.  From our
>  > application I want to be able to post our stored XML data to a
>  > specific Xform and have that data populated within the form when it
>  > is shown on the screen.
>  >
>  > For this to happen my "instance" data used to show and reference the
>  > fields in the XForm needs to have the Posted XML's data merged in to it,
>  > so that when I view the form I can see all the fields in the instance
>  > data, plus any populated ones filled in from the posted XML data.
>  >
>  > <supplier>
>  >     <name/>
>  >     <address1/>
>  >     <city/>
>  > </supplier>
>  >
>  > With posted data merged, instance would be:
>  >
>  > <supplier>
>  >     <name>BOB's Construction</name>
>  >     <address1>
>  >     <city>London</city>
>  > </supplier>
>  >
>  > Hope that makes sense!
>
>  Partially at least ;-) If somebody posts an XML document to the URL of
>  your XForms page, the page can retrieve the submitted instance using
>  XInclude, XSLT, or the xforms:instance/@src attribute, see the
>  following:
>
> http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-instance-initialization
>
>  This means that your XForms instance will actually contain the XML
>  document submitted to your page.
>
>  -Erik
>
>
> ________________________________
>
>
> --
> 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
>
>
>

--
Blog (XML, Web apps, Open Source):
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: instance & post data merge

Colin Seaman
Thanks Alex.

What I am sending is effectively
myxml=<mypostxml><tag1/><house>6</house></mypostxml>

over a HTTP Post, where "myxml" is the key and my instance XML is the value. I want to merge all of the default instance data with the new data coming in, so I assume I can do in page-flow.xpl:

<page path-info="/ops/test" default-submission="initial.xml">
<setvalue ref="/mypostxml" parameter="myxml"/>
</page>

I assume I don't have to do a key=>value for each XML tag!

In my XFORM, I have:

<xforms:instance id="instance_model_Document" src="initial.xml" >
 </xforms:instance>

Is this correct?

Colin Seaman
Senior Developer
 
Tradocs Ltd,
Tower Point,
44 North Road,
Brighton,
BN1 1YR

email:     [hidden email]
skype:     colin,seaman
telephone: 0870-1417031
website:   http://www.tradocs.net

This email and any files transmitted with it are confidential 
and intended solely for the use of the individual or entity to 
whom they are addressed. If you have received this email in 
error please contact Tradocs. Please note that any views or 
opinions presented in this email are solely those of the author 
and do not necessarily represent those of the company. Finally, 
the recipient should check this email and any attachments for 
the presence of viruses. The company accepts no liability for 
any damage caused by any virus transmitted by this email.
This content of this email is without prejudice.


Alessandro Vernet wrote:
Hi Colin,

If you are posting an XML document to the URL of your XForms page,
then you can directly use XInclude, as Erik said earlier.

If you are posting name/value pairs, for instance with an HTML form,
you first need to convert those name/value pairs in an XML document.
You can do this in your PFC with <setvalue>:

http://www.orbeon.com/ops/doc/reference-page-flow#url-extraction

Alex

On 11/15/06, Colin Seaman [hidden email] wrote:

 thanks, although I still can't manage to get this working.

 A HTML page I'm posting from:

 anotherserver.com/post.htm
 <form method="post" action="myserver_etc/xform/test/">
 <textarea name="myxml" rows="10" cols="10"></textarea>
 </form>

 Are there any examples of the correct coding for the page-flow/XForm that
allows me to merge whatever XML data I send with the above form in to my
current instance data?

 Colin Seaman
Senior Developer

Tradocs Ltd,
Tower Point,
44 North Road,
Brighton,
BN1 1YR

email: [hidden email]
skype: colin,seaman
telephone: 0870-1417031
website: http://www.tradocs.net

This email and any files transmitted with it are confidential
and intended solely for the use of the individual or entity to
whom they are addressed. If you have received this email in
error please contact Tradocs. Please note that any views or
opinions presented in this email are solely those of the author
and do not necessarily represent those of the company. Finally,
the recipient should check this email and any attachments for
the presence of viruses. The company accepts no liability for
any damage caused by any virus transmitted by this email.
This content of this email is without prejudice.


 Erik Bruchez wrote:
Colin,

 > yep; I'm using Orbeon specifically for rendering XForms.  From our
 > application I want to be able to post our stored XML data to a
 > specific Xform and have that data populated within the form when it
 > is shown on the screen.
 >
 > For this to happen my "instance" data used to show and reference the
 > fields in the XForm needs to have the Posted XML's data merged in to it,
 > so that when I view the form I can see all the fields in the instance
 > data, plus any populated ones filled in from the posted XML data.
 >
 > <supplier>
 >     <name/>
 >     <address1/>
 >     <city/>
 > </supplier>
 >
 > With posted data merged, instance would be:
 >
 > <supplier>
 >     <name>BOB's Construction</name>
 >     <address1>
 >     <city>London</city>
 > </supplier>
 >
 > Hope that makes sense!

 Partially at least ;-) If somebody posts an XML document to the URL of
 your XForms page, the page can retrieve the submitted instance using
 XInclude, XSLT, or the xforms:instance/@src attribute, see the
 following:

http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-instance-initialization

 This means that your XForms instance will actually contain the XML
 document submitted to your page.

 -Erik


________________________________


--
You receive this message as a subscriber of the [hidden email]
mailing list.
To unsubscribe: [hidden email]
For general help: [hidden email]
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: [hidden email]
For general help: [hidden email]
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: [hidden email] For general help: [hidden email] 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: instance & post data merge

Erik Bruchez
Administrator
Colin,

 > What I am sending is effectively
 > myxml=<mypostxml><tag1/><house>6</house></mypostxml>
 >
 > over a HTTP Post, where "myxml" is the key and my instance XML is the
 > value. I want to merge all of the default instance data with the new
 > data coming in, so I assume I can do in page-flow.xpl:
 >
 > <page path-info="/ops/test" default-submission="initial.xml">
 > <setvalue ref="/mypostxml" parameter="myxml"/>
 > </page>

My guess is that this will produce something like:

<mypostxml>
   &lt;mypostxml>&lt;tag1/>&lt;house>6&lt;/house>&lt;/mypostxml>
</mypostxml>

The reason is that nobody is parsing the XML document passed as a
parameter. But that may be what you are looking for, I don't know.

This assumes that initial.xml looks like this:

<mypostxml>
</mypostxml>

 > In my XFORM, I have:
 >
 > <xforms:instance id="instance_model_Document" src="initial.xml" >
 >  </xforms:instance>
 >
 > Is this correct?

It is correct XForms, but I don't think this will do what you think it
will do. This will load initial.xml from the disk. For instance
initialization techniques, check this part of the doc:

 
http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-instance-initialization

-Erik

--
Orbeon Forms - 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: instance & post data merge

Colin Seaman
OK, I've got hold of the XML I'm sending in via the /request processor.  Now I want to parse that string in to a usuable peice of XML.  In my page-flow.xpl I have:

<p:param type="input" name="instance"/>    
<p:param type="output" name="data"/>    

  <p:processor name="oxf:request">
       <p:input name="config" >
            <config>
                <include>/request/parameters/parameter[starts-with(name, 'xml')]</include>
            </config>
        </p:input>
        <p:output name="requestdata" id="data123"/>
  </p:processor>
 
<p:processor name="oxf:xslt" xmlns:p="http://www.orbeon.com/oxf/pipeline">
  <p:input name="datapreparse" href="#data123"/>
 <p:input name="config">
      <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
          <xsl:template match="/">
             <xsl:copy-of select="saxon:parse(doc('datapreparse')/parameters/parameter/value)"/>
          </xsl:template>
      </xsl:stylesheet>
  </p:input>
 
  <p:output name="dataout" ref="data" id="data" />
  </p:processor>

This, however, blows up with "No Error Message Provided" when I try in use:
  <xforms:instance id="request" >
        <xi:include href="input:data" />
     </xforms:instance>

To use this instance in my XForm.

Anyone any clues?

Is the value of "datapreparse" reference correctly in the saxon:parse function?

Colin Seaman
Senior Developer
 
Tradocs Ltd,
Tower Point,
44 North Road,
Brighton,
BN1 1YR

email:     [hidden email]
skype:     colin,seaman
telephone: 0870-1417031
website:   http://www.tradocs.net

This email and any files transmitted with it are confidential 
and intended solely for the use of the individual or entity to 
whom they are addressed. If you have received this email in 
error please contact Tradocs. Please note that any views or 
opinions presented in this email are solely those of the author 
and do not necessarily represent those of the company. Finally, 
the recipient should check this email and any attachments for 
the presence of viruses. The company accepts no liability for 
any damage caused by any virus transmitted by this email.
This content of this email is without prejudice.


Erik Bruchez wrote:
Colin,

> What I am sending is effectively
> myxml=<mypostxml><tag1/><house>6</house></mypostxml>
>
> over a HTTP Post, where "myxml" is the key and my instance XML is the
> value. I want to merge all of the default instance data with the new
> data coming in, so I assume I can do in page-flow.xpl:
>
> <page path-info="/ops/test" default-submission="initial.xml">
> <setvalue ref="/mypostxml" parameter="myxml"/>
> </page>

My guess is that this will produce something like:

<mypostxml>
  &lt;mypostxml>&lt;tag1/>&lt;house>6&lt;/house>&lt;/mypostxml>
</mypostxml>

The reason is that nobody is parsing the XML document passed as a
parameter. But that may be what you are looking for, I don't know.

This assumes that initial.xml looks like this:

<mypostxml>
</mypostxml>

> In my XFORM, I have:
>
> <xforms:instance id="instance_model_Document" src="initial.xml" >
>  </xforms:instance>
>
> Is this correct?

It is correct XForms, but I don't think this will do what you think it
will do. This will load initial.xml from the disk. For instance
initialization techniques, check this part of the doc:


http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-instance-initialization

-Erik


-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: [hidden email] For general help: [hidden email] 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: instance & post data merge

Alessandro  Vernet
Administrator
Colin,

What is page-flow.xpl? I assume that this the model for your page. In
addition to the "No error message provided", can you see a Java
exception? In addition to you finding a solution to this issue, it
would be nice if we could reproduce the issue and improve Orbeon Forms
to provide a better error message in this case.

Alex

On 11/21/06, Colin Seaman <[hidden email]> wrote:

>
>  OK, I've got hold of the XML I'm sending in via the /request processor.
> Now I want to parse that string in to a usuable peice of XML.  In my
> page-flow.xpl I have:
>
>  <p:param type="input" name="instance"/>
>  <p:param type="output" name="data"/>
>
>    <p:processor name="oxf:request">
>         <p:input name="config" >
>              <config>
>
> <include>/request/parameters/parameter[starts-with(name,
> 'xml')]</include>
>              </config>
>          </p:input>
>          <p:output name="requestdata" id="data123"/>
>    </p:processor>
>
>  <p:processor name="oxf:xslt"
> xmlns:p="http://www.orbeon.com/oxf/pipeline">
>    <p:input name="datapreparse" href="#data123"/>
>   <p:input name="config">
>        <xsl:stylesheet version="2.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>            <xsl:template match="/">
>               <xsl:copy-of
> select="saxon:parse(doc('datapreparse')/parameters/parameter/value)"/>
>            </xsl:template>
>        </xsl:stylesheet>
>    </p:input>
>
>    <p:output name="dataout" ref="data" id="data" />
>    </p:processor>
>
>  This, however, blows up with "No Error Message Provided" when I try in use:
>    <xforms:instance id="request" >
>          <xi:include href="input:data" />
>       </xforms:instance>
>
>  To use this instance in my XForm.
>
>  Anyone any clues?
>
>  Is the value of "datapreparse" reference correctly in the saxon:parse
> function?
>
>  Colin Seaman
> Senior Developer
>
> Tradocs Ltd,
> Tower Point,
> 44 North Road,
> Brighton,
> BN1 1YR
>
> email: [hidden email]
> skype: colin,seaman
> telephone: 0870-1417031
> website: http://www.tradocs.net
>
> This email and any files transmitted with it are confidential
> and intended solely for the use of the individual or entity to
> whom they are addressed. If you have received this email in
> error please contact Tradocs. Please note that any views or
> opinions presented in this email are solely those of the author
> and do not necessarily represent those of the company. Finally,
> the recipient should check this email and any attachments for
> the presence of viruses. The company accepts no liability for
> any damage caused by any virus transmitted by this email.
> This content of this email is without prejudice.
>
>
>  Erik Bruchez wrote:
> Colin,
>
>  > What I am sending is effectively
>  > myxml=<mypostxml><tag1/><house>6</house></mypostxml>
>  >
>  > over a HTTP Post, where "myxml" is the key and my instance XML is the
>  > value. I want to merge all of the default instance data with the new
>  > data coming in, so I assume I can do in page-flow.xpl:
>  >
>  > <page path-info="/ops/test" default-submission="initial.xml">
>  > <setvalue ref="/mypostxml" parameter="myxml"/>
>  > </page>
>
>  My guess is that this will produce something like:
>
>  <mypostxml>
>
> &lt;mypostxml>&lt;tag1/>&lt;house>6&lt;/house>&lt;/mypostxml>
>  </mypostxml>
>
>  The reason is that nobody is parsing the XML document passed as a
>  parameter. But that may be what you are looking for, I don't know.
>
>  This assumes that initial.xml looks like this:
>
>  <mypostxml>
>  </mypostxml>
>
>  > In my XFORM, I have:
>  >
>  > <xforms:instance id="instance_model_Document" src="initial.xml" >
>  >  </xforms:instance>
>  >
>  > Is this correct?
>
>  It is correct XForms, but I don't think this will do what you think it
>  will do. This will load initial.xml from the disk. For instance
>  initialization techniques, check this part of the doc:
>
>
> http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-instance-initialization
>
>  -Erik
>
>  ________________________________
>
>
> --
> 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
>
>
>

--
Blog (XML, Web apps, Open Source):
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: instance & post data merge

Colin Seaman
to my knowledge there was a JAVA exception.  I believe the problem lied with the incorrect data I posted to the page (the data at /request/parameters/parameter/name/value, which was a string of XML. 

It appears that there was a missing ? before the end of the <? xml ... ?>  declaration - see Ryan Puddephatt's post on 27th Nov ... cheers Ryan! :-)

The code below is indeed my page-flow.xpl model, and within the XForm I'm using i'm grabbing input:data using an xi:include
Colin Seaman
Senior Developer
 
Tradocs Ltd,
Tower Point,
44 North Road,
Brighton,
BN1 1YR

email:     [hidden email]
skype:     colin,seaman
telephone: 0870-1417031
website:   http://www.tradocs.net

This email and any files transmitted with it are confidential 
and intended solely for the use of the individual or entity to 
whom they are addressed. If you have received this email in 
error please contact Tradocs. Please note that any views or 
opinions presented in this email are solely those of the author 
and do not necessarily represent those of the company. Finally, 
the recipient should check this email and any attachments for 
the presence of viruses. The company accepts no liability for 
any damage caused by any virus transmitted by this email.
This content of this email is without prejudice.


Alessandro Vernet wrote:
Colin,

What is page-flow.xpl? I assume that this the model for your page. In
addition to the "No error message provided", can you see a Java
exception? In addition to you finding a solution to this issue, it
would be nice if we could reproduce the issue and improve Orbeon Forms
to provide a better error message in this case.

Alex

On 11/21/06, Colin Seaman [hidden email] wrote:

 OK, I've got hold of the XML I'm sending in via the /request processor.
Now I want to parse that string in to a usuable peice of XML.  In my
page-flow.xpl I have:

 <p:param type="input" name="instance"/>
 <p:param type="output" name="data"/>

   <p:processor name="oxf:request">
        <p:input name="config" >
             <config>

<include>/request/parameters/parameter[starts-with(name,
'xml')]</include>
             </config>
         </p:input>
         <p:output name="requestdata" id="data123"/>
   </p:processor>

 <p:processor name="oxf:xslt"
xmlns:p="http://www.orbeon.com/oxf/pipeline">
   <p:input name="datapreparse" href="#data123"/>
  <p:input name="config">
       <xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
           <xsl:template match="/">
              <xsl:copy-of
select="saxon:parse(doc('datapreparse')/parameters/parameter/value)"/>
           </xsl:template>
       </xsl:stylesheet>
   </p:input>

   <p:output name="dataout" ref="data" id="data" />
   </p:processor>

 This, however, blows up with "No Error Message Provided" when I try in use:
   <xforms:instance id="request" >
         <xi:include href="input:data" />
      </xforms:instance>

 To use this instance in my XForm.

 Anyone any clues?

 Is the value of "datapreparse" reference correctly in the saxon:parse
function?

 Colin Seaman
Senior Developer

Tradocs Ltd,
Tower Point,
44 North Road,
Brighton,
BN1 1YR

email: [hidden email]
skype: colin,seaman
telephone: 0870-1417031
website: http://www.tradocs.net

This email and any files transmitted with it are confidential
and intended solely for the use of the individual or entity to
whom they are addressed. If you have received this email in
error please contact Tradocs. Please note that any views or
opinions presented in this email are solely those of the author
and do not necessarily represent those of the company. Finally,
the recipient should check this email and any attachments for
the presence of viruses. The company accepts no liability for
any damage caused by any virus transmitted by this email.
This content of this email is without prejudice.


 Erik Bruchez wrote:
Colin,

 > What I am sending is effectively
 > myxml=<mypostxml><tag1/><house>6</house></mypostxml>
 >
 > over a HTTP Post, where "myxml" is the key and my instance XML is the
 > value. I want to merge all of the default instance data with the new
 > data coming in, so I assume I can do in page-flow.xpl:
 >
 > <page path-info="/ops/test" default-submission="initial.xml">
 > <setvalue ref="/mypostxml" parameter="myxml"/>
 > </page>

 My guess is that this will produce something like:

 <mypostxml>

&lt;mypostxml>&lt;tag1/>&lt;house>6&lt;/house>&lt;/mypostxml>
 </mypostxml>

 The reason is that nobody is parsing the XML document passed as a
 parameter. But that may be what you are looking for, I don't know.

 This assumes that initial.xml looks like this:

 <mypostxml>
 </mypostxml>

 > In my XFORM, I have:
 >
 > <xforms:instance id="instance_model_Document" src="initial.xml" >
 >  </xforms:instance>
 >
 > Is this correct?

 It is correct XForms, but I don't think this will do what you think it
 will do. This will load initial.xml from the disk. For instance
 initialization techniques, check this part of the doc:


http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-instance-initialization

 -Erik

 ________________________________


--
You receive this message as a subscriber of the [hidden email]
mailing list.
To unsubscribe: [hidden email]
For general help: [hidden email]
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: [hidden email]
For general help: [hidden email]
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: [hidden email] For general help: [hidden email] 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: instance & post data merge

Alessandro  Vernet
Administrator
Colin,

So it looks like you have resolved the problem. If you get this
problem again, let us know. I consider an error message that says "No
error message provided" as a bug by itself :).

Alex

On 11/28/06, Colin Seaman <[hidden email]> wrote:

>
>  to my knowledge there was a JAVA exception.  I believe the problem lied
> with the incorrect data I posted to the page (the data at
> /request/parameters/parameter/name/value, which was a
> string of XML.
>
>  It appears that there was a missing ? before the end of the <? xml ... ?>
> declaration - see Ryan Puddephatt's post on 27th Nov ... cheers Ryan! :-)
>
>  The code below is indeed my page-flow.xpl model, and within the XForm I'm
> using i'm grabbing input:data using an xi:include
>  Colin Seaman
> Senior Developer
>
> Tradocs Ltd,
> Tower Point,
> 44 North Road,
> Brighton,
> BN1 1YR
>
> email: [hidden email]
> skype: colin,seaman
> telephone: 0870-1417031
> website: http://www.tradocs.net
>
> This email and any files transmitted with it are confidential
> and intended solely for the use of the individual or entity to
> whom they are addressed. If you have received this email in
> error please contact Tradocs. Please note that any views or
> opinions presented in this email are solely those of the author
> and do not necessarily represent those of the company. Finally,
> the recipient should check this email and any attachments for
> the presence of viruses. The company accepts no liability for
> any damage caused by any virus transmitted by this email.
> This content of this email is without prejudice.
>
>
>  Alessandro Vernet wrote:
> Colin,
>
>  What is page-flow.xpl? I assume that this the model for your page. In
>  addition to the "No error message provided", can you see a Java
>  exception? In addition to you finding a solution to this issue, it
>  would be nice if we could reproduce the issue and improve Orbeon Forms
>  to provide a better error message in this case.
>
>  Alex
>
>  On 11/21/06, Colin Seaman <[hidden email]> wrote:
>
>
>   OK, I've got hold of the XML I'm sending in via the /request processor.
>  Now I want to parse that string in to a usuable peice of XML.  In my
>  page-flow.xpl I have:
>
>   <p:param type="input" name="instance"/>
>   <p:param type="output" name="data"/>
>
>     <p:processor name="oxf:request">
>          <p:input name="config" >
>               <config>
>
>  <include>/request/parameters/parameter[starts-with(name,
>  'xml')]</include>
>               </config>
>           </p:input>
>           <p:output name="requestdata" id="data123"/>
>     </p:processor>
>
>   <p:processor name="oxf:xslt"
>  xmlns:p="http://www.orbeon.com/oxf/pipeline">
>     <p:input name="datapreparse" href="#data123"/>
>    <p:input name="config">
>         <xsl:stylesheet version="2.0"
>  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>             <xsl:template match="/">
>                <xsl:copy-of
> select="saxon:parse(doc('datapreparse')/parameters/parameter/value)"/>
>             </xsl:template>
>         </xsl:stylesheet>
>     </p:input>
>
>     <p:output name="dataout" ref="data" id="data" />
>     </p:processor>
>
>   This, however, blows up with "No Error Message Provided" when I try in
> use:
>     <xforms:instance id="request" >
>           <xi:include href="input:data" />
>        </xforms:instance>
>
>   To use this instance in my XForm.
>
>   Anyone any clues?
>
>   Is the value of "datapreparse" reference correctly in the saxon:parse
>  function?
>
>   Colin Seaman
>  Senior Developer
>
>  Tradocs Ltd,
>  Tower Point,
>  44 North Road,
>  Brighton,
>  BN1 1YR
>
>  email: [hidden email]
>  skype: colin,seaman
>  telephone: 0870-1417031
>  website: http://www.tradocs.net
>
>  This email and any files transmitted with it are confidential
>  and intended solely for the use of the individual or entity to
>  whom they are addressed. If you have received this email in
>  error please contact Tradocs. Please note that any views or
>  opinions presented in this email are solely those of the author
>  and do not necessarily represent those of the company. Finally,
>  the recipient should check this email and any attachments for
>  the presence of viruses. The company accepts no liability for
>  any damage caused by any virus transmitted by this email.
>  This content of this email is without prejudice.
>
>
>   Erik Bruchez wrote:
>  Colin,
>
>   > What I am sending is effectively
>   > myxml=<mypostxml><tag1/><house>6</house></mypostxml>
>   >
>   > over a HTTP Post, where "myxml" is the key and my instance XML is the
>   > value. I want to merge all of the default instance data with the new
>   > data coming in, so I assume I can do in page-flow.xpl:
>   >
>   > <page path-info="/ops/test" default-submission="initial.xml">
>   > <setvalue ref="/mypostxml" parameter="myxml"/>
>   > </page>
>
>   My guess is that this will produce something like:
>
>   <mypostxml>
>
> &lt;mypostxml>&lt;tag1/>&lt;house>6&lt;/house>&lt;/mypostxml>
>   </mypostxml>
>
>   The reason is that nobody is parsing the XML document passed as a
>   parameter. But that may be what you are looking for, I don't know.
>
>   This assumes that initial.xml looks like this:
>
>   <mypostxml>
>   </mypostxml>
>
>   > In my XFORM, I have:
>   >
>   > <xforms:instance id="instance_model_Document" src="initial.xml" >
>   >  </xforms:instance>
>   >
>   > Is this correct?
>
>   It is correct XForms, but I don't think this will do what you think it
>   will do. This will load initial.xml from the disk. For instance
>   initialization techniques, check this part of the doc:
>
>
> http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-instance-initialization
>
>   -Erik
>
>   ________________________________
>
>
>  --
>  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
>
>
>
>
>
>  ________________________________
>
>
> --
> 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
>
>
>

--
Blog (XML, Web apps, Open Source):
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet