从XSD创建Web表单,然后输出xml表单 [英] create web form from XSD and then output xml form

查看:165
本文介绍了从XSD创建Web表单,然后输出xml表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个工具,该工具允许某人输入应保存为XML文件的配方,我已经创建了XSD,但我想知道如何在网页上制作一个允许用户输入的表格他们的食谱,并遵循模式.我一直在研究Ajax和Jquery,但确实感到困惑.任何帮助将不胜感激!

I am creating a tool that allows someone to input recipes which should then be saved as an XML file, I have created my XSD but I was wondering how I can make a form on my web page that will allow the user to enter their recipe and adhere to the schema. I have been looking into Ajax and Jquery but am really confused. Any help would be much appreciated!

尼克

推荐答案

您的信息很少.因此,如果我要说明显的道歉. 基本方法是创建一个实现所有数据元素的页面.使用javascript/Jquery验证所需的元素.将页面发送到服务器后,读取所有元素并创建XML文档.

Your information is a bit minimal. So if I'm stating the obvious my apologes. The basic approach would be to create a page that implements all your data elements. Use javascript/Jquery to validate requiered elements. After sending the page to the server read all elements and create a XML document.

您没有指定服务器处理语言,但是这种方法可以与任何已知的语言一起使用,例如PHP,C#,VB.NET,Ruby,Perl.

You didn't specify your server handling language, but this approach can be used with any of the known languages such as PHP, C#, VB.NET, Ruby, Perl.

根据您的选择,创建和维护页面的模板代码的工作量或多或少.您还可以使用XSLT从XSD生成HTML页面.读取数据也可以使用XSLT完成.如果您使用Smalltalk Web应用程序框架Seaside,则页面是从代码生成的,因此只有一个地方可以维护您的应用程序.但这并没有得到广泛使用,因此可能不是一种选择.其他大多数语言都使用页面模板.

Depending on your choice creating and maintaining the template code of the page is less or more work. You could also use XSLT to generate a HTML page from the XSD. Reading data can also be done with XSLT. If you use the Smalltalk web application framework Seaside, pages are generated from code, so there is only one place to maintain your application. But that is not really widely used so that might not be an option. Most other languages use templates for pages.

这篇关于从XSD创建Web表单,然后输出xml表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆