|
|
Conversion from HTML to XML
HtmlToXml converter reads a pair of the normal HTML (or any other mark-up languages, such as XHTML, WML or HDML).
The HTML for the valid case will include the tags for the initial CGI FORM.
Another one (the HTML for the invalid case) will include the tags for the same CGI FORM along with the error messages (and the additional HTML tags).
Please include the error messages (and the additional HTML tags) for case that all the inputs are invalid.
For example, the pair of the HTML for the CGI FORM in the previous section will look like:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Input validation example 1</title> </head> <body> <h1>Input validation example 1</h1> <p> Hello! Please fill in the CGI FORM below and click <i>Send</i> button. <br> <form action="Verify" method="post"> <center> <table border="1"> <tr> <td>E-mail:</td> <td><input type="text" name="email" value=""></td> </tr> <tr> <td>Age:</td> <td><input type="text" name="age" value=""></td> </tr> <tr><td colspan="2" align="center"><input type="submit" name="button" value="Send"> </td></tr> </table> </center> </form> </p> </body> </html> |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Input validation example 1</title> </head> <body> <h1>Input validation example 1</h1> <p> Hello! Please fill in the CGI FORM below and click <i>Send</i> button. <br> <form action="Verify" method="post"> <center> <table border="1"> <tr> <td><font color="#ff0000">E-mail. ex)foo@bar.com </font>:</td> <td><input type="text" name="email" value=""></td> </tr> <tr> <td><font color="#ff0000">Age. Only 0-9 </font>:</td> <td><input type="text" name="age" value=""></td> </tr> <tr><td colspan="2" align="center"><input type="submit" name="button" value="Send"> </td></tr> </table> </center> </form> </p> </body> </html> |
Once you convert a pair of HTML into the XML, you can edit it by HtmlToXmlEdit.
By this the XML editor, you can view/edit each element in the XML, or append/insert the new element into the XML.
Or, it may be the good starting point to walk through the existing XML by HtmlToXmlEdit.
Please download your favorite example from our web site and explore the XML in it.
Then, you can grasp the whole image of this XML.
Anyway, we recommend you also to read through the tutorial of HtmlToXmlEdit before going ahead. (It will not take more than 5 minutes.)
HtmlToXml can also generate the template for the dynamic response.
The template XML is simpler than the XML for the input validation, because the validity of each value do not matter.
By the help of the Java API by OOP-Reserch (such as FormGenerator), your Servlet can insert the values between the tag groups in the template XML.
And your Servlet can send the concatenated tags back to the web browser.
For example, your Servlet may query the SQL table and insert the selected data between the tag groups of the template XML.
For details about how to generate template XML, please read another tutorial.
Java and all Java-based trademarks and logos are trademarks or registered of Sun Microsystems, Inc. in the United States and other countries.
|
|
ALL CONTENTS COPYRIGHT 2002, Jun Inamori. All rights reserved.
Any questions and comments are welcome to
Jun Inamori
.