[urgent] HTML form => XML file

Reply

Join Date: Apr 2005
Posts: 13
Reputation: dakkar is an unknown quantity at this point 
Solved Threads: 0
dakkar dakkar is offline Offline
Newbie Poster

[urgent] HTML form => XML file

 
0
  #1
Apr 28th, 2005
Hi, I've an HTML form (I generated it from a XML schema .xsd file)
I'd like to know a good way to save the form input data (POST/GET don't matter) to an XML file (or fragment) that can be validated with the XML schema that I used to generate the form.


I think that a solution can be this one:

1) with my XSLT I generate the HTML form from the given xml schema

2) with another XSLT I generate a xml file that is a "template" for my html form

3) when the user submit the data with my html form I read the "template" (step 2 and search for the "name" and the respective "value" to give values to my DOM tree (created by that "template")

4) now I must validate it (this fragment) using that XML schema (suggestions? Now I'm able to validate a FILE, not a fragment in memory)

5) if it's valid, I must append to another xml file, that is a kind of simple database, like:
<database>
<record id="1">
....my fields....
</record>
.....
</database>
I think that I must load the "database" XML file and append the fragment with the proper DOM function (I'm right?)


I'm using: Xerces, Xalan, Tomcat (all the latest versions)


Thank you in Advance

Dakkar
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 19
Reputation: mavines is an unknown quantity at this point 
Solved Threads: 1
mavines's Avatar
mavines mavines is offline Offline
Newbie Poster

Re: [urgent] HTML form => XML file

 
0
  #2
Dec 16th, 2007
My answer - use JAXB [https://jaxb.dev.java.net/] parser. It is able to validate almost any XML from any source. Just learn some tricks and you will solve any XML related task. But the only disadvantage here - JAXB is fully supported in Java 6 only.
http://f-download.com - the download portal
http://ksmhost.net - FREE or cheap, reliable hosting.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JSP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC