954,574 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

[urgent] HTML form => XML file

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:

....my fields....

.....

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

dakkar
Newbie Poster
14 posts since Apr 2005
Reputation Points: 10
Solved Threads: 0
 

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.

mavines
Newbie Poster
19 posts since Mar 2006
Reputation Points: 10
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You