473,406 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Manually loading XML data into XForms

Nepomuk
3,112 Expert 2GB
Hello everybody!
I'm pretty new to XForms and doing a project with XForms and eXist, so I have an XML file as a database. The problem I'm having is the following:

My XForms document looks something like this:
Expand|Select|Wrap|Line Numbers
  1. ...
  2.   <xf:model version="1.0">
  3.    <xf:instance id="data-instance" src="data.xml" xmlns="">
  4.     <Data>
  5.      <FirstName/>
  6.      <LastName/>
  7.     </Data>
  8.    </xf:instance>
  9.    <xf:submission id="read-from-file" method="get" action="http://localhost:8080/exist/rest/db/eXist_test/data.xml" replace="instance" instance="data-instance"/>
  10.    <xf:submission id="save-to-file" method="put" action="http://localhost:8080/exist/rest/db/eXist_test/data.xml" replace="instance" instance="data-instance"/>
  11.   </xf:model>
  12. ...
  13.   <xf:input ref="/Data/FirstName"><xf:label>First Name: </xf:label></xf:input><br/>
  14.   <xf:input ref="/Data/LastName"><xf:label>Last Name: </xf:label></xf:input><br/>
  15.   <xf:submit submission="read-from-file"><xf:label>Load</xf:label></xf:submit>
  16.   <xf:submit submission="save-to-file"><xf:label>Save</xf:label></xf:submit>
  17. ...
  18.  
and my XML document looks like this:
Expand|Select|Wrap|Line Numbers
  1. <Data>
  2.  <FirstName>Peter</FirstName>
  3.  <LastName>Parker</LastName>
  4. </Data>
  5.  
Now, when the document loads, it loads the values from the XML file into the Document, ditto when I click on "Load" and when I click on "Save" it submits the changes to my XML file. So far so good - but now I want to be able to add new tags to the XML file via the webinterface (e.g. <MiddleName>). When I have further paths in my XForms document, they just won't display, unless they belong to a different instance (which isn't a choice I guess, because it will only submit the data of one instance when I save).

My idea was therefore to cut out the src="data.xml" part in the instance description and just load the entries manually. Also, the read-from-file submission would have to be changed. However, I can't seem to be able to find anything like that online. Any ideas or suggestions, how do do this differently?

Greetings,
Nepomuk
Aug 24 '10 #1
3 2498
Nepomuk
3,112 Expert 2GB
Does nobody have an idea? Any bit of help would be great.

Greetings,
Nepomuk
Aug 27 '10 #2
Dormilich
8,658 Expert Mod 8TB
sorry, but I only glanced over XForms. you may be able to change the XML by JavaScript, though I didn’t try that either.
Aug 28 '10 #3
Nepomuk
3,112 Expert 2GB
I just had another thought, maybe this could work, though I have no idea how to implement it:

Let's assume, when I want to add a new tag, I click on an "Add" button. What happens then, is that a different instance is selected for saving and this instance gets a copy of the data from the original instance plus the new stuff that's supposed to be added. So, the new question would be: How do I copy data from one instance to another?

Greetings,
Nepomuk
Sep 8 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Thanos | last post by:
Hello, I need some help with a small problem. I have a fixed length format dat file with the first and last lines been the header and trailer file information. The header, body and trailer...
0
by: anonymous | last post by:
Thanks Michelle, How could I achieve the second one.I do not like Flashing windows in response to selection of an item. I agree the data transfer is very little but the same data transferred for...
1
by: Angel | last post by:
Is there a way to display a message using an aspx page with controls on it that the data is loading for the page without having to display one html page then reloading the aspx page. in other words...
5
by: schapopa | last post by:
I have a flex grid and I am loading data to this flex grid in this way While sqldr.Read j = j + 1 MSFlexGrid1PLSummary.set_TextMatrix(MSFlexGrid1PLSummary.Row, MSFlexGrid1PLSummary.Col,...
1
by: ezmiller | last post by:
Hi, I have a web page that loads some data from a series of xml files into a series of arrays. After that, a series of function process that data in the arrays for display on the web page. The...
0
by: gnih | last post by:
Hello, I'm using data binding connect GUI control and properties. problem is In same special case, I need manually update data from control to properties. is there a easy way to do it? notes, I...
7
by: 2b|!2b==? | last post by:
I am attempting to manually load debug symbols for a module. I am doing it by carrying out the ff steps: i). Select the call stack window ii). right click and select 'Load Symbols' from...
0
by: teressa | last post by:
Hi, I am new to Grid view Control. I have a page with many icons on it for different purposes. I want to add a Grid View where I want to load data with different columns. Below is my...
0
by: ganeshvkl | last post by:
hi please,how Calculate time for loading data from Ms Access into Flex Grid anybody known reply soon
3
by: selvialagar | last post by:
Hi Everybody.. I have lot of data stored in the database depending upon the time the experiment conducted. Once th experiment is completed, i have to store that data into the excel. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.