2 Replies - 503 Views - Last Post: 15 November 2015 - 01:50 PM Rate Topic: ***-- 2 Votes

#1 chering   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 27
  • Joined: 11-October 15

Reading an XML file, following an C# class made from XSD and ....

Posted 15 November 2015 - 07:00 AM

( not enough space in Title sorry ) Reading an XML file, following and C# class made from XSD and visualizing all that.

Good day all :) ! So I have an issue to be honest, I have no idea how to do that and while searching I have not found the right tool, so I need some guideline in doing the following:

1. I have and XSD schema that describes a metalanguage for creating assignments ( tests for students )

2. From that XSD I have created the corresponding C# classes

3. What I have to do next is when I upload a XML file ( that is pre-made and is following the XSD rules ) my program must read.

4. The next part is the tricky one in which i have no idea. After that the program has read the XML it must create a corresponding GUI. So if the program read an XML that describes a question with four answers it must recreate that. The question with the four answers for the user to chose one of them.

So please if anybody has encountered something like this to please give me some guidelines and point me in the right direction.

1. How to use the C# class
2. How to read the uploaded XML and follow the XSD schema ( is that correct or it should follow the C# classes I do not know )
3. How after reading it to visualize all of it.

It is very very hard for me, so please help. I just need to be pointed in the right direction. Thank you all with all my heart !

Is This A Good Question/Topic? 0
  • +

Replies To: Reading an XML file, following an C# class made from XSD and ....

#2 Martyr2   User is offline

  • Programming Theoretician
  • member icon

Reputation: 5291
  • View blog
  • Posts: 14,124
  • Joined: 18-April 07

Re: Reading an XML file, following an C# class made from XSD and ....

Posted 15 November 2015 - 01:33 PM

You need to create controls dynamically at runtime for this. Read in your file, grab a question, generate something like a label control and put it on your form. Read the questions, create the appropriate number of radio button controls and put them on the form as well.

Check out the following MSDN link. Pay attention to the first code sample they show where they go about generating a bunch of controls dynamically using the keyword "new"...

https://support.micr...en-us/kb/319266

The code that follows in the article is them then customizing those controls including changing size, color and position. Then the subtopic adding the controls to the form is the third part of the process.

:)
Was This Post Helpful? 0
  • +
  • -

#3 chering   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 27
  • Joined: 11-October 15

Re: Reading an XML file, following an C# class made from XSD and ....

Posted 15 November 2015 - 01:50 PM

Martyr2 thank you very very much for the awesome answer I will carefully look into it and try it out :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1