问题描述
您好我正在编写基于XML的Visual Studio应用程序,我需要导入一个包含6列乘以400行数据的简单矩阵。场景是用户输入问题编号,应用程序查找问题并从源数据中以下面的格式显示答案的5列。我不得不在决定如何构建XML时遇到麻烦?
(注意我还会有各种其他屏幕来维护源数据文件)。
最终屏幕上显示的一般问题格式
2.5自闭症是一种终生的发育障碍,会影响一个人与其他人交流的方式,并与之相关。它还会影响他们如何理解周围的世界。 (www.autism.org.uk)
2.7肯定:
•紧急情况即999/112,GPS
•更容易保持联系
•远程通信
•娱乐即应用程序,相机,互联网
否定:
•分心
•费用
•犯罪
•网络欺凌
5.18答案:D所有这些:
•保险公司可以期望在灾难索赔中支付更多费用。
•渔业将遭受低鱼种的影响。
•一些葡萄酒产区将不再维持葡萄作物
5.30回答:C:回收。 (回收是将废料回收并重新加工用于新产品的过程。)
我还有一张带有此表的Excel表格如下:
问题无答案参考答案格式答案说明
2.5段自闭症是一种终生的发育障碍,会影响一个人与......沟通的方式...... />
2.7段落阳性:
2.7 bullet紧急情况即999/112,GPS
2.7 bullet更容易保持联系
2.7 bullet远程通信
2.7 bullet娱乐即应用程序,相机,互联网
2.7段落否定:
2.7 bullet分心
2.7子弹费用
2.7 bullet犯罪
2.7子弹网络欺凌
等......(这个论坛不太可读,但你得到了要点。
Hi I am writing a XML Based Visual Studio application, whereby I need to import a simple matrix of 6 columns by 400 rows of data. The scenario is that the user puts in question number and the application looks up the question and display the 5 columns of the answer in the below format from the source data. I am having to trouble deciding how to structure the XML ?
(Note I will also have various other screen to maintain the source data file).
General Question Format to be shown on Final Screen
2.5 Autism is a lifelong developmental disability that affects how a person communicates with, and relates to,
other people. It also affects how they make sense of the world around them. (www.autism.org.uk)
2.7 Positives:
•Emergencies i.e. 999/112, GPS
•Easier to keep in touch
•Long Range communication
•Entertainment i.e. apps, camera, internet
Negatives:
•Distraction
•Cost
•Crime
•Cyber Bullying
5.18 Answer: D. All of these:
•Insurance companies can expect to pay out more in disaster claims.
•The fishing industry will suffer from low fish stocks.
•Some wine regions will no longer sustain grape crops
5.30 Answer: C: Recycling. (Recycling is the process through which waste materials are recovered and reprocessed for use in new products).
I also have an Excel table with this Table as follows :
Question NoAnswer RefAnswer FormattingAnswer Description
2.5 ParagraphAutism is a lifelong developmental disability that affects how a person communicates with...
2.7 ParagraphPositives:
2.7 bulletEmergencies i.e. 999/112, GPS
2.7 bulletEasier to keep in touch
2.7 bulletLong Range communication
2.7 bulletEntertainment i.e. apps, camera, internet
2.7 ParagraphNegatives:
2.7 bulletDistraction
2.7 bulletCost
2.7 bulletCrime
2.7 bulletCyber Bullying
etc... (Not very readable with this Forum but you get the gist.
XML: OPTION 1 - Flat Record
<Question_Answer_Line>
<Question No>
<Answer Ref>
<Answer Formatting> ‘ Notice this field governs the way the screen will format the answer. i.e. buttlets
<Answer Description>
<Answer Ref Section>
<Answer Ref Colour>
<Answer Image>
<Answer Hyperlink>
</Question_Answer_Line>
XML: OPTION 2 - Master/Child Record Type Definition
<Question_Answer_MASTER_QUESTION>
<Question No>
<Answer Ref>
<Answer Description>
<Answer Ref Section>
<Answer Ref Colour>
<Answer Image>
<Answer Hyperlink>
<Question_Answer_Child> ‘ Notice Master/Child governs the way the screen will format the answer. i.e. buttlets
<Question No>
<Answer Ref>
<Answer Description>
<Question_Answer_Child>
</Question_Answer_MASTER_QUESTION> (or something like that).
The above XML OPTION 1 - is how I might proceed for the Schema definition but the alternative is to Master/Child type record definition… For the very experienced I would image you would make the latter option work but by putting the "Answer Formatting" tag I can control how the output should be displayed by the program.
Can anyone offer any advise ?
Thanks in advance. Kuldip.
推荐答案
<parent>
<name>Harry Hacker</name>
<child1>Copy</child1>
<child2>Paste</child2>
</parent>
更好的结构:
Better structure:
<parent>
<name>Harry Hacker</name>
<childs>
<child id="1">Copy</child>
<child id="2">Paste</child>
</childs>
</parent>
问问自己,当Harry得到第三个孩子时,这两个结构有什么不同。
做什么你需要做的第一种情况与第二种情况相比?
Ask yourself what is the difference in the two structures when Harry gets a third kid.
What do you need to do in the first case compared to the second case?
这篇关于为数据加载困境创建有效的XML模式......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!