Using non-xml application data structures

I am developing a survey tool. The survey will be very static, and because of this, I can avoid creating a kind of desktop designer-researcher to post 167 questions in the survey (all questions on 1-5 ratings in a box with a radio or layout).

I was thinking about creating survey questions in a large XML file, but my non-technical employee who will make frequent changes to the survey is likely to do something that violates the integrity / validity of the original XML file (consider punctuation and special characters).

An XML file might look something like this:

    <questions>
    <question>
        <type>checkbox</type>
        <text>Which beers do you like most</text>
        <choices>Bud,Miller,Piels</choices>
        <Required>true</Required>
    </question>
    <question>
        <type>radio</type>
        <text>Which beer is your favorite</text>
        <choices>Bud,Miller,Piels</choices>
        <Required>true</Required>
    </question>
</questions>

Please use your imagination that this structure will be a little more complicated and that there will be 165 more questions.

, - , . 167 , , 37 - - , 37.

.Net:

  • .
  • -, . p-, .asp.,

    questions q = new questions()
    
    q.type = "checkbox";
    q.text = "which beers do you enjoy"'
    q.choices = "Bud,Miller,Peils";
    q.required = true;
    q.add
    
    q.type = "radio";
    q.text = "what is your favorite beer";
    q.choices = "Bud,Miller,Peils";
    q.required = true;
    q.add
    

, .cs ( , ) , .

, , :

  • . XML, XML .

  • WWYD - ? ?

    • , .
    • , .
    • , , ( ).

- , .

+4
6

XML .
, XML.
, .
, , XML, .

?
?
, .
?
, , .

XML .
XML XmlReader
doug, .
XML.
XML (A List).
, IEnumerable.
, IEnumerable.

WPF WinForms.
ListBox DataTemplate.
DataTemplate , hassel.
, . , RadioButtons, . LINQ , CollectionViewSource.

XML , .
.

, XML XSD - , .

+1

Excel... CSV, , Excel, . , , , CSV, .

, Excel, / XMl.

+2

, , YAML.

YAML - , , , C, Perl Python, XML .

:

questions:
   - id:       1
     type:     checkbox
     text:     Which beers do you like most
     choices:  Bud,Miller,Piels
     Required: true

   - id:       2
     type:     radio
     text:     Which beer is your favorite
     choices:  Bud,Miller,Piels
     Required: true

YAML .NET( ):

https://github.com/aaubry/YamlDotNet

http://yaml.codeplex.com/

http://www.codeproject.com/Articles/28720/YAML-Parser-in-C

http://yaml-net-parser.sourceforge.net/

+1

xml, , . XML-, . http://symbolclick.com/

, .

+1

;

a: , , , / , , .. , ​​ "" , !

b: , /, , ? - ? , , / - , , XML , -, ?

, , , , ( ). , , ! , , , - , .

TL;DR; , , , , , ( , , ). , , , .

0

winforms GUI, .

xml-, xml .

? , . ( xml, , CSV)
.
. , , .

If your colleagues do not have programming or xml editing experience, they will hate you if you instruct them to edit some kind of "code".
Our secretaries put a hand in front of their faces and started chanting "no, no, no ..." when I tell them how to manage VBA macros.

enter image description here

0
source

Source: https://habr.com/ru/post/1527591/


All Articles