Results 1 to 6 of 6

Thread: [RESOLVED] [2008] XML file. Some help please

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Resolved [RESOLVED] [2008] XML file. Some help please

    Hi,

    I have a database with some data in it. My application reads this database and orders the data into a Treeview.

    Now, I would like to stop using the database since the requirement of a database connection etc etc are a bit too much hassle for something that I'm sure can be done much easier.
    Also, it is supposed to be read only, the user cannot edit it, so there is really no need for a database, right?

    My idea was to use an XML file instead of the database.

    Now, I know nothing about XML so I hope you guys could tell me if it was possible, and how I should start using it?


    My data is order something like this:
    First of all, there is a "Category" field. There are about 10 categories.
    Then, in each of the categories, there are "Commands". Each command also has a "Description".

    Something like this:
    Code:
    CATEGORY  |  COMMAND  |  DESCRIPTION
    ----------|-----------|-------------
    Cat. 1	  | Command 1 | This is command 1.
    Cat. 1	  | Command 2 | This is command 2.
    Cat. 1    | Command 3 | And command 3.
    Cat. 2    | Command 1 | This is command 1, in Cat 2
    Cat. 2    | Command x | Blaa...
    Cat. 3    | ...	      | ...
    Could you show me roughly how this would look in XML?

    Thanks!


    Something I came up with, I have no idea if it's right:

    Code:
      <category CAT="Cat. 1">
        <command COM="Command 1">
          <descr>This is command 1.</descr>
          <descr2>Some other description, also for Command 1</descr2>
        </command>
    
        <command COM="Command 2">
          <descr>This is command 2.</descr>
          <descr2>Some other descr. for command 2</descr2>
        </command>
        
        etc...
      </category>
    
      <category CAT="Cat. 2">
        <command COM="Command 1">
          <descr>This is command 1, in Cat 2</descr>
          <descr2>Some other...</descr2>
        </command>
        
        etc...
      </category>
               
      etc...

    EDIT

    I have also found examples that handle it like this, what would be more easy to acces ?
    Code:
    <category>
      <name>Cat. 1</name>
      <command>
          <name>Command 1</name>
          <descr>This is command 1.</descr>
          <descr2>Some other description, also for Command 1</descr2>
      </command>
    </category>
    Last edited by NickThissen; Feb 3rd, 2008 at 12:58 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width