xform not saving data into xml.

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

xform not saving data into xml.

Asit Sinha
Hi

I am working on xforms. I am new developer on this platform. I have
two questions.

1)  I am creating a simple application. In application I want a one
text box and save button.
        One I put the text on textbox and click save button then data should
be save in xml.
Can any one give me solution my query.

2) I have example but its also not working. I don’t know why  xml
isn’t saving data.

<?xml version="1.0" encoding="ASCII"?>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xforms="http://www.w3.org/2002/xforms">
  <head>
     <title>XForms Submit Example</title>
      <xforms:model>
         <xforms:instance xmlns="">
            <MyData>
               <Data1>One</Data1>
               <Data2>Two</Data2>
               <Data3>Three</Data3>
            </MyData>
         </xforms:instance>

  <xforms:submission id="save-instance-to-client"
      method="put"
      action="file://C:/tmp/xforms/my-data.xml"
      replace="instance"
      instance="my-instance"
    />


      </xforms:model>
  </head>
  <body>
    <xforms:submit submission="save-instance-to-clien">
         <xforms:label>Save</xforms:label>
      </xforms:submit>

  </body>
</html>


Kindly immediate reply me.
Asit Sinha

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: xform not saving data into xml.

Aaron Reed
If you were using the Firefox xforms extension, you should have seen an
error message in the Error Console when you tried to submit saying,

"Error: XForms Error (8): id (save-instance-to-clien) does not refer to
a submission element
Source File: file:///c:/test.xhtml
Line: 0
Source Code:
<xforms:submit submission="save-instance-to-clien"/>"

As you can see, @submission is set to "save-instance-to-clien" and the
id of the submission element is "save-instance-to-client" (note that you
are missing a 't' from the end).

Also you are trying to replace an instance that isn't there, the value
of @instance doesn't refer to an instance element.  You don't have an
instance element with that id.  If you remove replace="instance" and
@instance="my-instance" from your submission element then your form will
work.

--Aaron

Asit wrote:

> Hi
>
> I am working on xforms. I am new developer on this platform. I have
> two questions.
>
> 1)  I am creating a simple application. In application I want a one
> text box and save button.
> One I put the text on textbox and click save button then data should
> be save in xml.
> Can any one give me solution my query.
>
> 2) I have example but its also not working. I don’t know why  xml
> isn’t saving data.
>
> <?xml version="1.0" encoding="ASCII"?>
> <html xmlns="http://www.w3.org/1999/xhtml"
>       xmlns:ev="http://www.w3.org/2001/xml-events"
> xmlns:xforms="http://www.w3.org/2002/xforms">
>   <head>
>      <title>XForms Submit Example</title>
>       <xforms:model>
>          <xforms:instance xmlns="">
>             <MyData>
>                <Data1>One</Data1>
>                <Data2>Two</Data2>
>                <Data3>Three</Data3>
>             </MyData>
>          </xforms:instance>
>
>   <xforms:submission id="save-instance-to-client"
>       method="put"
>       action="file://C:/tmp/xforms/my-data.xml"
>       replace="instance"
>       instance="my-instance"
>     />
>
>
>       </xforms:model>
>   </head>
>   <body>
>     <xforms:submit submission="save-instance-to-clien">
>          <xforms:label>Save</xforms:label>
>       </xforms:submit>
>
>   </body>
> </html>
>
>
> Kindly immediate reply me.
> Asit Sinha
>
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: xml posting

Asit Sinha
Hi
Thanks for your reply.
Actual my main object is post the xml on client side.
I am using xform so we are facing the problem after created xml.
how i post this xml to any web application
Kindly suggest me.
Thanks
Asit Sinha


On Sep 2, 10:56 pm, Aaron Reed <[hidden email]> wrote:

> If you were using the Firefox xforms extension, you should have seen an
> error message in the Error Console when you tried to submit saying,
>
> "Error: XForms Error (8): id (save-instance-to-clien) does not refer to
> a submission element
> Source File: file:///c:/test.xhtml
> Line: 0
> Source Code:
> <xforms:submit submission="save-instance-to-clien"/>"
>
> As you can see, @submission is set to "save-instance-to-clien" and the
> id of the submission element is "save-instance-to-client" (note that you
> are missing a 't' from the end).
>
> Also you are trying to replace an instance that isn't there, the value
> of @instance doesn't refer to an instance element.  You don't have an
> instance element with that id.  If you remove replace="instance" and
> @instance="my-instance" from your submission element then your form will
> work.
>
> --Aaron
>
>
>
> Asit wrote:
> > Hi
>
> > I am working on xforms. I am new developer on this platform. I have
> > two questions.
>
> > 1)  I am creating a simple application. In application I want a one
> > text box and save button.
> >    One I put the text on textbox and click save button then data should
> > be save in xml.
> > Can any one give me solution my query.
>
> > 2) I have example but its also not working. I don’t know why  xml
> > isn’t saving data.
>
> > <?xml version="1.0" encoding="ASCII"?>
> > <html xmlns="http://www.w3.org/1999/xhtml"
> >       xmlns:ev="http://www.w3.org/2001/xml-events"
> > xmlns:xforms="http://www.w3.org/2002/xforms">
> >   <head>
> >      <title>XForms Submit Example</title>
> >       <xforms:model>
> >          <xforms:instance xmlns="">
> >             <MyData>
> >                <Data1>One</Data1>
> >                <Data2>Two</Data2>
> >                <Data3>Three</Data3>
> >             </MyData>
> >          </xforms:instance>
>
> >   <xforms:submission id="save-instance-to-client"
> >       method="put"
> >       action="file://C:/tmp/xforms/my-data.xml"
> >       replace="instance"
> >       instance="my-instance"
> >     />
>
> >       </xforms:model>
> >   </head>
> >   <body>
> >     <xforms:submit submission="save-instance-to-clien">
> >          <xforms:label>Save</xforms:label>
> >       </xforms:submit>
>
> >   </body>
> > </html>
>
> > Kindly immediate reply me.
> > Asit Sinha

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms