Results 1 to 3 of 3

Thread: XML Question

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2005
    Posts
    394

    XML Question

    Currently I have a dataset which contains two tables: Loads and Maps. Each load will contain at least one map but could contain more. I'm using a relational db schem where the load has a row ID (RID) and each map entry has a RID that is used to associate it to a load. My XML looks like this:

    Code:
      <Loads>
        <desc>This is my Description</desc>
        <options>-noio</options>
        <loaded>0</loaded>
        <rid>1</rid>
      </Loads>
      <Map>
        <rid>1</rid>
        <drive>S</drive>
        <path>Some path</path>
      </Map>
    <Map>
        <rid>1</rid>
        <drive>R</drive>
        <path>Some other path</path>
      </Map>
    This works but I would like to have the map data embedded in the Loads table:

    Code:
    <Loads>
        <desc>This is my Description</desc>
        <options>-noio</options>
        <loaded>0</loaded>
        <Maps>
            <Map>
                <drive>S</drive>
                <path>Some path</path>
            </Map>
            <Map>
                <drive>R</drive>
                <path>Some other path</path>
            </Map>
        </Maps>
    </Loads>
    I'm using ds.writexml to populate the xml files. How would I organize the dataset to generate the example above?

  2. #2
    Fanatic Member Mr.No's Avatar
    Join Date
    Sep 2002
    Location
    Mauritius
    Posts
    651

    Re: XML Question

    I don't think the dataset allows you to embed children groups within a master. All it knows it that there are datatables that are linked through datarelations. If you want to generate proper XML then may be you should look at persisting custom objects as XML or programmatically fabricate the xml document.
    Using VB.NET 2003/.NET 1.1/C# 2.0
    http://del.icio.us/rajoo
    Blow your mind, smoke gunpowder
    Ashes to ashes, dust to dust
    If God won't have you, the devil will. - Author unknown
    Don't follow me, I'm lost too ...

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2005
    Posts
    394

    Re: XML Question

    I was afraid of that.

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