Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

XML as Db

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,
I have a project where the server cannot have a db but must have dynamic content so I was thinking about using XML rather than text files but am unsure about a few things. I have used XSL in the past for the presentation of the XML on the web. Is it possible to use Java in JSPs/Servlets to access and present the content in the XML file. If so is it advisable to use Java? Can I use Jsps to update the XML file? Should I?
Any thoughts would be great
Williery (novice)
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you can use Java and XSL to present content dynamically based on XML residing somewhere on the disk, for example. You could also take a look at the Apache Cocoon project for an XML-oriented web application framework.
Regarding the modification of these XML files, is it enough to upload new files or do you need to "edit" them online? That's a bit more trickier than just uploading files...
 
Will Reilly
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cheers for that,
Well basically I would have to update these files on line. A user/client fills in a form and this data is stored to the xml file. This data can later be viewed on line by the same client, edited and then be updated to the approriate entry in the xml file. Is this very difficult? Another requirement is that I have to be able to download this data(xml file) to another machine so that new entries can be read and updated to a db. So I was thinking about writing a small application that reads the file and updates the db. So I couldn't use xsl as it is not an internet application. Could I use java to extract this data and update the db appropriately.
Summary
User fills form, data stored in db on the web server, my boss clicks opens up an application on his machine which automatically downloads the file, extracts the data and updates his db on his machine.
Any thoughts would be great
Cheers inadvance
Williery
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have not already, take a look at the Apache XIndice project

Apache Xindice is a database designed from the ground up to store XML data or what is more commonly referred to as a native XML database. The name is pronounced zeen-dee-chay in your best faux Italian accent. Don't worry if you get it wrong though, we won't mind. We just care that you spell it correctly.


Bill
 
Will Reilly
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That looks good but the thing is we can't put/install a db on the webserver coz the hosting company will charge a lot more for it. Thats why I was thinking of using a single xml file and just program in the updates using sax. This is my first time doing something like this (usually use a relational db) so have no idea if it is correct.
Any insights are most welcome
Willie
 
Will Reilly
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Me thinks I should flesh this out a bit, bare with me...
Heres the basic summary of the site
1)User fills form to register his cv, the data is stored in an xml file containing all the data for all candidates on the web server. Specific data is retreived from this file depending on client request and presented to him/her where he/she can edit it and save it (web server writes it out to the appropriate entry in the xml file or creates a new entry in the xml file).
2)my boss clicks opens up a stand alone application on his machine which automatically downloads the xml file, extracts any new data and updates his db on his machine.
So for the second part I have to extract data and update it to a db independent of the webserver.
So I need to:
1)add new entries to an xml file: user enter in form: name: will nationality: irish
entry in xml file
i.e. <candidate> <name>will</name><nationality>irish</nationality></candidte>
2)locate this entry
3) edit it in a form and update same entry in xml file:user enter name: bill
i.e. <name>bill</name> is changed
This can all be done with xsl, which is good for the webserver part but on the standalone machine I need to find the new candidate(ie put in an attribute that says whether it is new or not, no problem). Extract the data bewteen the brackets of the elements for each candidate and put them in the db without using xslt. Can this be done? I was hoping to make a standalone Java application that would do this but looking at the Sun site i can't see if it can be or not.
Any suggestions would be greatly appreciated
Williery
 
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic