Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XForms

Status
Not open for further replies.

Sanuye

Programmer
Apr 7, 2007
6
RO
Hi everyone!
I am trying to save the data that a user types into a xform. I want to have it in a separate xml file, because i need to process it afterwards. This is my xform so far:

<html xmlns=" xmlns:xforms=" <head>
<title>Lindenmayer Fractals</title>
<xforms:model>
<xforms:instance xmlns="">
<data>
<Axioma/>
<Rules/>
<Headings/>
<Rotation/>
</data>
</xforms:instance>
</xforms:model>
</head>
<body>
<xforms:input ref="Axioma">
<xforms:label>Initial Axiom: </xforms:label>
</xforms:input>
<br/><br/>
<xforms:input ref="Rules">
<xforms:label>Transformation Rules: </xforms:label>
</xforms:input>
<br/><br/>
<xforms:input ref="Headings">
<xforms:label>Initial Heading (degrees) </xforms:label>
</xforms:input>
<br/><br/>
<xforms:input ref="Rotation">
<xforms:label>Rotation Unit (degrees) </xforms:label>
</xforms:input>

</body>
</html>

Thanks :)
 
Just taking a stab-in-the-dark... but surely the submitted result of the form would be processed server-side (assuming you were using some kind of browser to render the xform)?

When you submit the form (do you even get to submit the form), can't you then parse the results into an XML file?

What are you using to render the form? Some kind of bespoke application, or just an extension in Firefox?

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
(to BabyJeffy)
Hi :)
I am using a Frefox add-on, available at for processing the form. The problem is that I didn't find a clear explanation for how to submit the form to the server. I know how to parse it once I have it.
ps. sorry if I haven't been clear,I am a beginner in this ...
 
I've stumbled across a useful URL containing examples:


You basically need to add a xf:submission to the form...
Code:
<xf:submission id="save" method="put" action="myData.xml" ref="/MyData"/>

And it looks like the XML is saved at the path specified in the ref attribute. Take a peek at the URL and check their example.

Fun stuff!
Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
me said:
And it looks like the XML is saved at the path specified in the ref attribute.
This is wrong [smile] The ref attribute has nothing to do with where the xml is saved! I should have read that link in more detail before posting!

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
Yes, I think it has the same meaning as the reference in: <xforms:input ref="Axioma"> (the xml tag) . but still, it doesn't work :-( (I used the <xforms:submission id="save" method="put" action="myData.xml" ref="Axioma"/> )

You can try the form at After saving, in the directory there should be the xml file, but the 'put' method doesn't create it.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top