Click here to Skip to main content
15,895,538 members
Home / Discussions / XML / XSL
   

XML / XSL

 
Questionxml web service testing Pin
Jamal Encami10-Jan-07 8:08
professionalJamal Encami10-Jan-07 8:08 
QuestionParsing an XML tree in Win CE Pin
lkrishn8-Jan-07 18:46
lkrishn8-Jan-07 18:46 
QuestionHow do I get a list of valid attributes for a given element? Pin
Edmundisme8-Jan-07 14:28
Edmundisme8-Jan-07 14:28 
AnswerRe: How do I get a list of valid attributes for a given element? Pin
Stefan Troschuetz8-Jan-07 22:54
Stefan Troschuetz8-Jan-07 22:54 
GeneralRe: How do I get a list of valid attributes for a given element? Pin
Edmundisme9-Jan-07 8:07
Edmundisme9-Jan-07 8:07 
QuestionCSS related question! Pin
Tina P7-Jan-07 19:18
Tina P7-Jan-07 19:18 
AnswerRe: CSS related question! Pin
Christian Graus8-Jan-07 15:18
protectorChristian Graus8-Jan-07 15:18 
QuestionHow to load XML objects into .Net classes [modified] Pin
nzmike7-Jan-07 14:45
nzmike7-Jan-07 14:45 
Hi all,

Hoping someone can point me in the right direction here. I'm writing a VB.Net 2.0 WinForms admin app to allow users to do maintenance on an Oracle database behind another very large app.

To keep the size of the admin app down and to avoid a maintenance nightmare when the tables (about 70 of them) change I am trying to write it so it's totally automated. I already have code to read the schema of each table to get the columns and then I have a form that adds an appropriate custom control for each type of table column. This works very well but I need it to be advanced enough to hide some columns, make sure others are entered, validate some others, etc, etc.

So my idea is to have an XML file (see below) containing the tables and columns which can be maintained and when the app starts it would read the file and load the data into .Net classes which correspond to the XML (see class definitions below). I can then use these table and column classes to apply custom behaviour to the custom edit form I already have.

So, looking at the XML and class definitions (both kept VERY simple for illustration purposes) can anyone tell me how best to go about this? How could I best read the XML file in and convert it to the classes I've defined?

TIA for any help... I know how to write using lots of fairly manual code but am hoping there is a smarter & quicker way to to do this.

Mike.



<SAMTABLES >
<SAMTABLE >
<TABLE TableName="EMPLOYEE" CustomForm="N" />
<COLUMN ColumnName="ID" ColumnType="int" Required="N" Visible="N"/>
<COLUMN ColumnName="SURNAME" ColumnType="string" Required="Y" Visible="Y" Label="Surname"/>
<COLUMN ColumnName="FIRST_NAME" ColumnType="string" Required="Y" Visible="Y" Label="First Name"/>
<COLUMN ColumnName="EMPLOYEE_NUMBER" ColumnType="int" Required="Y" Visible="Y" Label="Employee No."/>
</SAMTABLE>
<SAMTABLE>
<TABLE TableName="ORDERS" CustomForm="Y" />
<COLUMN ColumnName="ID" Required="N" Visible="N"/>
<COLUMN ColumnName="ORDER_DATE" ColumnType="date" Required="Y" Visible="Y" Label="Order Date"/>
<COLUMN ColumnName="ORDER_ITEMS" ColumnType="int" Required="Y" Visible="Y" Label="Items"/>
<COLUMN ColumnName="ORDER_TOTAL" ColumnType="decimal" Required="Y" Visible="Y" Label="Total"/>
</SAMTABLE>
</SAMTABLES>


Public Class SAMTables

Public Tables() as SAMTAble

End Class

Public Class SAMTable

Public TableName as String
Public CustomForm as String
Public Columns() as SAMColumn

End Class

Public Class SAMColumn

Public ColumnName as String
Public ColumnType as String
Public Required as String
Public Visible as String
Public Label as String

End Class




-- modified at 22:01 Sunday 7th January, 2007
AnswerRe: How to load XML objects into .Net classes Pin
Stefan Troschuetz7-Jan-07 21:25
Stefan Troschuetz7-Jan-07 21:25 
GeneralRe: How to load XML objects into .Net classes Pin
nzmike8-Jan-07 13:30
nzmike8-Jan-07 13:30 
QuestionWORD2007 XML and embedded fonts Pin
RaymondM7-Jan-07 0:24
RaymondM7-Jan-07 0:24 
QuestionHow to Encrypt and Decrypt the XML file? Pin
Sameer_Thakur5-Jan-07 21:17
Sameer_Thakur5-Jan-07 21:17 
AnswerRe: How to Encrypt and Decrypt the XML file? Pin
led mike6-Jan-07 19:41
led mike6-Jan-07 19:41 
QuestionHow to auto upgrade the XML files at the time of software upgradation ?? Pin
zxc892-Jan-07 19:25
zxc892-Jan-07 19:25 
AnswerRe: How to auto upgrade the XML files at the time of software upgradation ?? Pin
led mike4-Jan-07 6:51
led mike4-Jan-07 6:51 
GeneralRe: How to auto upgrade the XML files at the time of software upgradation ?? Pin
zxc894-Jan-07 20:52
zxc894-Jan-07 20:52 
GeneralRe: How to auto upgrade the XML files at the time of software upgradation ?? Pin
led mike5-Jan-07 4:40
led mike5-Jan-07 4:40 
GeneralRe: How to auto upgrade the XML files at the time of software upgradation ?? Pin
zxc897-Jan-07 17:13
zxc897-Jan-07 17:13 
GeneralRe: How to auto upgrade the XML files at the time of software upgradation ?? Pin
led mike8-Jan-07 5:39
led mike8-Jan-07 5:39 
GeneralRe: How to auto upgrade the XML files at the time of software upgradation ?? Pin
nzmike8-Jan-07 13:35
nzmike8-Jan-07 13:35 
GeneralRe: How to auto upgrade the XML files at the time of software upgradation ?? Pin
led mike8-Jan-07 17:16
led mike8-Jan-07 17:16 
QuestionCreate an XmlDocument from an XmlNode? Pin
Edmundisme2-Jan-07 8:35
Edmundisme2-Jan-07 8:35 
AnswerRe: Create an XmlDocument from an XmlNode? Pin
Stefan Troschuetz2-Jan-07 9:37
Stefan Troschuetz2-Jan-07 9:37 
GeneralRe: Create an XmlDocument from an XmlNode? Pin
Edmundisme3-Jan-07 11:56
Edmundisme3-Jan-07 11:56 
AnswerRe: Create an XmlDocument from an XmlNode? Pin
George L. Jackson3-Jan-07 12:44
George L. Jackson3-Jan-07 12:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.