需要基于XML结构生成一个表单. [英] Need to generate a form based on XML structure.

查看:120
本文介绍了需要基于XML结构生成一个表单.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


下面是XML结构

Hi
Below is the XML structure

<?xml version="1.0" encoding="utf-8" ?> 
<Salary>
    <empNo Required="true" List="false"></empNo> 
    <Basic Required="true" List="false">Basic Salary</Basic> 
    <HRA List="false">Housing Allow</HRA> 
    <TA List="false">TA</TA> 
    <Others List="true">Other Allowances</Others> 
    <Total List="false" Required="True">Total Salary</Total> 
    <Sex List="true">
    <Sex>
        <gender>Male</gender> 
        <gender>Female</gender> 
    </Sex> 
</Salary> 



我需要使用xml Nodes创建Webform.表单布局需要通过阅读xml结构来生成.如果xml节点包含的属性列表为true,则添加下拉列表;如果xml节点包含的列表值为false,则添加文本框作为输入控件. xml节点元素的值(例如"Housing Allow","TA")应显示为表单中的标签,并且需要添加提交按钮以保存数据.

请指导我去做..

感谢



I am having a requirement of Creating a Webform with the xml Nodes . The Form layout need to be generated by reading the xml structure. If the xml node contains the property list as true add the dropdown list ,If it contains list value as false add the textbox as input controls. The Values of the xml node elements values like’Housing Allow’ ,’TA’ should display as label in the form and need to add a submit button to save the Data.

Please guide me to do this..

Thanks

推荐答案

有很多方法可以完成您需要做的事情.这是您使用尚未开发的技能的地方-分析.您提供的XML的内容很简单,并且很难确定您需要做什么.

除此之外,这里没有人会真正为您编写代码.如果您尝试编写代码并遇到特殊问题,请寻求帮助.不要来这里指望我们为您编写代码,尤其是免费的.
There are many approaches to doing what you need to do. This is where you use that skill you haven''t developed yet - analysis. The XML you''ve provided is simple in its content, and it isn''t that hard to work out what you need to do.

Beyond that, nobody here is going to actually write the code for you. If you make an attempt to write the code, and have a SPECIFIC problem, ask for help. Don''t come here expecting us to write code for you, especially for free.


感谢约翰,我知道有很多方法可以实现这一任务,这令我感到困惑.您能否让我知道执行此操作的最佳方法.

再次感谢.
Thanks John, I know that there are many approaches to achieve this task thats where I am confused. Could you please let me know the best possible approach to do this.

Thanks again.


这篇关于需要基于XML结构生成一个表单.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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